Can't refresh jqgrid with loadonce: true

后端 未结 1 1344
后悔当初
后悔当初 2020-12-22 03:44

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

相关标签:
1条回答
  • 2020-12-22 04:15

    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 讨论(0)
提交回复
热议问题