2012-05-09 34 views
0

我正在使用jqGrid 4.0.0,beforeProcessing永远不会被解雇每个postBack,它一直没有被触发,请协助!jQgrid beforeProcessing不会触发

$('#jqgInventory').jqGrid({ 
    autowidth: true, 
    caption: 'Inventory', 
    datatype:'json', 
    forceFit: true, 
    gridview: true, 
    height: 500, 
    hidegrid: false, 
    ignoreCase: true, 
    loadui: 'disable', 
    pager:'#pager', 
    mtype: 'post', 
    rowNum:25, 
    shrinkToFit: true, 
    url:'/MCI/Inventory/Inventory/GetIndexGridData', 
    viewrecords: true, 
    postData: { modelView: JSON.stringify(model), __RequestVerificationToken: $('[name="__RequestVerificationToken"]').val() }, 
    beforeProcessing: function(data, status,xhr){beforeProcessing(data,status,xhr)}, 
    beforeRequest: function() {$('#gridScript').block();}, 
    beforeSelectRow: function(rowid, e) {return false;}, 
    gridComplete: function() {$('#lblVehicleCount').html($('#jqgInventory').getGridParam('records'));$('#gridScript').unblock();Inventory.modifyGridCellClick();}, 
    loadComplete: function(xhr) {GetGridData(xhr);}, 
+0

我从来没有使用jqGrid,但你运行哪个测试来确定before函数从不运行? – Huangism

+0

beforeProcessing中有一个警报(数据,状态,xhr),永远不会触发 –

回答

3

如果要使用jqGrid的新功能,应使用jqGrid的最新版本。你可以从here下载它。

jqGrid 4.0.0中不会调用回调函数beforeProcessing,因为它是在4.2.0版本中引入的。

+0

是的,我已经意识到 –