Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8370091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:49:40+00:00 2026-06-09T13:49:40+00:00

I obviously need to refresh the grid from the server after I create/edit/delete a

  • 0

I obviously need to refresh the grid from the server after I create/edit/delete a row.
I have checked all of Oleg’s aswers regarding the reload and I still can’t make it work. What am I doing wrong? Why does a such simple matter have to be so complicated.

I would also like to close the forms after posting.. but that’s the next step

Here is my code:

$(function(){ 
         var roles = null;
                $.ajax({
                    'async': false,
                    'global': false,
                    'url': '<?php echo base_url().'utils/Admin_Rest/get_roles'?>',
                    'dataType': 'json',
                    'success': function (data) {
                        roles = data;
                    }
                });
var comptes=$("#Comptes");
comptes.jqGrid({
            url:'<?php echo base_url().'utils/Admin_rest/get_comptes'?>',    
            mtype : "post",           
            datatype: "json",           
            colNames:['Nom','Prenom','Email','Utilisateur','Telephone', 'Password','Role'],   
            colModel:[  
                {name:'first_name',index:'first_name',editable:true, editrules: { required: true }, edittype:'text',search:false, align:"center"},
                {name:'last_name',index:'last_name',editable:true, edittype:'text', editrules: { required: true }, search:false,  align:"center"},
                {name:'email',index:'email',editable:true, editrules: { required: true }, edittype:'text',search:false, align:"center"},
                {name:'username',index:'username',editable:true, editrules: { required: true }, edittype:'text',search:false, align:"center"},
                {name:'phone',index:'phone',editable:true, editrules: { required: true }, edittype:'text',search:false, align:"center"},
                 {name:'password',index:'password',editable:true, hidden:true, editrules: { edithidden:true }, edittype:'password',search:false, align:"center"},                       
                {name:'role',index:'role', editable:true, editrules: {required: true},  edittype:'select', search:true, stype:'select', 
                    searchoptions:{ value:roles},
                    editoptions:{ value:roles}}
                ],

            rowNum:10,
            jsonReader: {
                 root: "rows", 
                  page: "page", 
                  total: "total", 
                  records: "records", 
                  repeatitems: false, 
                  id: "id",
                  userdata: "userdata"
            },                  
            width: 850,
            height: "100%",
            rowList:[10,20,30],
            pager: '#pager',
            sortname: 'id',
            viewrecords: true,
            loadonce:true,
            rownumbers: true,
            gridview: true,
            pagination:true,
            editurl: "<?php echo base_url().'utils/Admin_rest/edit_compte'?>",  

            caption:""
            }).navGrid('#pager',
                    {edit:true,
                    add: true, 
                    del:true,refresh:false},
              { // edit options
                    beforeShowForm: function(frm) { 
                        comptes.jqGrid('setColProp', 'password', {editrules: {required: false}});
                    }
                }, 
                { // add options
                    beforeShowForm: function(frm) { 
                        comptes.jqGrid('setColProp', 'password', {editrules: {required: true}});
                }
                });

comptes.jqGrid('navGrid', '#pager', {refresh: false},
        { // Edit options
            afterSubmit: function () {
                $(this).jqGrid('setGridParam', {datatype:'json'});
                return [true,'']; // no error
            }
        },
        { // Add options
            afterSubmit: function () {
                $(this).jqGrid('setGridParam', {datatype:'json'});
                return [true,'',false]; // no error and no new rowid
            }
        },
        { // Delete options
            afterSubmit: function () {
                $(this).jqGrid('setGridParam', {datatype:'json'});
                return [true,'']; // no error
            }
        }
    );
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:49:42+00:00Added an answer on June 9, 2026 at 1:49 pm

    It seems that the parameters were given wrong. The correct pager params would be:

    .navGrid('#pager',
                        {edit:true,
                        add: true, 
                        del:true,refresh:false},
                  { // edit options
                        beforeShowForm: function(frm) { 
                            comptes.jqGrid('setColProp', 'password', {editrules: {required: false}});
                        },
                        afterSubmit: function() {
                            comptes.jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid');
                              return [true,'',false]; // no error and no new rowid
                             }
                    }, 
                    { // add options
                        beforeShowForm: function(frm) { 
                            comptes.jqGrid('setColProp', 'password', {editrules: {required: true}});
                        },
                         afterSubmit: function() {
                                comptes.jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid');
                            return [true,'']; // no error
                        }
                    } ,
                    { // delete options
                         afterSubmit: function() {
                                comptes.jqGrid('setGridParam',{datatype:'json'}).trigger('reloadGrid');
                            return [true,'']; // no error
                        }
                    }       
                   );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database entry that I need to update. This method obviously doesn't
I'm trying to create a PHP based game where you have to do all
I need to fill a UITableView from an NSSet data source. Obviously I want
I need to create a clickable 8 by 8 grid in pygame. Right now
i have an application made with tab host. i need to refresh my listview
Potentially embarrassing question, but there is obviously something I'm missing that I want/need to
I have four DB tables in an Oracle database that need to be rewritten/refreshed
We need to create a web-based frontend for displaying some data. The problem is
I have a table with products, their amount and their price. I need to
I have a gridview in ASP.NET. If I go to any page (obviously not

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.