2012-05-09 36 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

是的,我已經意識到 –