Reload of jqgrid not happening with loadonce:true

前端 未结 3 1338
死守一世寂寞
死守一世寂寞 2020-12-03 19:54

I am newbie in using jqgrid.

While new page load the grid is properly loading the data from database. Afterwards due to loadonce: true the grid is not reloading the

3条回答
  •  时光取名叫无心
    2020-12-03 20:47

    Thanks,

            $("#list1").jqGrid('navGrid', '#pager1', {refresh: false},
    { // Edit options
        afterSubmit: function () {$(this).jqGrid('setGridParam', {datatype:'xml'});
            return [true,'']; // no error
        }
    },
    { // Add options
        afterSubmit: function () {
            $(this).jqGrid('setGridParam', {datatype:'xml'});
            return [true,'',false]; // no error and no new rowid
        }
    },
    { // Delete options
        afterSubmit: function () {
            $(this).jqGrid('setGridParam', {datatype:'xml'});
            return [true,'']; // no error
        }
    });  jQuery("#list1").jqGrid('navGrid','#pager1',{edit:true,add:true,del:true,view:false},{url: "product.php" },{closeAfterEdit: true,closeAfterAdd: true});
           jQuery("#list1").jqGrid('gridResize',{minWidth:350,maxWidth:850,minHeight:80, maxHeight:350}).trigger('reloadGrid');
           $('#list1').jqGrid('setGridParam', {datatype:'xml'});
           $('#list1').trigger('reloadGrid', [{page:1}]);
    

    works for me.once again thanks a lot.

提交回复
热议问题