Jqgrid数据更新上的实时功能单击,但不更新数据



我正在尝试更新实时功能上的Jqgrid数据更新,单击但不更新数据。

我试过了jQuery(网格).jqGrid("clearGridData");jQuery("网格")。jqGrid('setGridParam', {data: dataToLoad});jQuery(网格).trigger (reloadGrid);

这是我的网格代码它在一个函数中我为每个按钮点击调用这个函数

  jQuery("#procedureResultGrid").jqGrid({
       loadonce:false,
    rowList : [ 10, 20, 50,100 ],
       data : jsonText,
       datatype : 'local',
       gridview: true,
       rowNum : 10,
       width : '100%',
       height : 'auto',
       colModel : [{
           name : 'name',
           sortable:false,
           width : 130,
           classes: "col1"
       },{
           name : 'rowv_1',
           formatter: valueFormatFunctionFirst,
           width : 60,
           sortable:false
       }
       ,{
           name : 'row1',
           width : 25,
           formatter: calculatedFormatFunctionFirst,
           classes: "imageValue"

       },{
           name : 'row4',
           width : 50,
           formatter: calculatedPersendFunctionFirst,
           classes: "persendValue"
        },{
           name : 'rowv_2',
           formatter: valueFormatFunctionSecond,
           width : 60,
           sortable:false
       }
       ,{
           name : 'row3',
           width : 25,
           formatter: calculatedFormatFunctionSecond,
           classes: "imageValue"
       },{
       name : 'row4',
       width : 50,
       formatter: calculatedPersendFunctionSecond,
       classes: "persendValue"
    }
       ,{
           name : 'rowv_3',
           width : 60,
           formatter: valueFormatFunctionThird,
           sortable:false
       }
       ,{
           name : 'row5',
           width : 25,
           formatter: calculatedFormatFunctionThird,
           classes: "imageValue"
       },{
       name : 'row6',
       width : 50,
       formatter: calculatedPersendFunctionThird,
       classes: "persendValue"
    }
       ,{
           name : 'rowv_4',
           formatter: valueFormatFunctionForth,
           width : 60,
           sortable:false
       }
       ,{
           name : 'row5',
           width : 25,
           formatter: calculatedFormatFunctionForth,
           classes: "imageValue"
       },{
       name : 'row6',
       width : 50,
       formatter: calculatedPersendFunctionForth,
       classes: "persendValue"
    },{
        name : 'rowv_4',
        formatter: valueFormatFunctionYTD,
           width : 60,
           sortable:false
       }
       ,{
           name : 'row5',
           width : 25,
           formatter: calculatedFormatFunctionYTD,
           classes: "imageValue"
       },{
       name : 'row6',
       width : 50,
       formatter: calculatedPersendFunctionYTD,
       classes: "persendValue"
    }
       ],
       pager : jQuery('#pager'),
       afterInsertRow: function (rowid, rowdata) {
    if(rowid%2==0)
           $("#procedureResultGrid").jqGrid('setRowData', rowid, false, { background: '#F2F2F2' });
        else
            $("#procedureResultGrid").jqGrid('setRowData', rowid, false, { background: 'white' });
       }
   });
   $("#procedureResultGrid").fluidGrid({
       base : "result-grid",
       offset : -20
   });
   $("#pager").show();
          $("#procedureResultGrid").setGridParam({datatype:'local',sortname:'values.aggregate.'+totalCostIndex+'.data.'+addKeyYear(keyYear), sortorder: 'desc'}).trigger('reloadGrid');

我也试着排序,它也不工作

我刚刚添加了from create grid和

 $("#procedureResultGrid").GridUnload();
然后

   $("#procedureResultGrid").trigger('reloadGrid');

for me.

谢谢

最新更新