我正在網格上進行內聯編輯,但似乎無法獲取任何與該編輯關聯的事件。jqGrid:爲什麼我沒有爲網格編輯定義的事件?
在這裏,我有afterSubmit:我希望它在用戶編輯網格中的數量字段後觸發,但它從不觸發。
$('#tblLines').jqGrid({
url: createUrl('/CRA/GetLines/'),
editurl: '/CRA/EditModifyLine',
emptyrecords: '',
datatype: 'json',
mtype: 'GET',
colNames: ['Group', 'Description', 'Quantity'],
colModel: [
{ name: 'Group', index: 'Group', width: 100, align: 'left' },
{ name: 'Description', index: 'Description', width: 400, align: 'left' },
{ name: 'Quantity', index: 'Quantity', width: 150, align: 'left', editable: true },
pager: jQuery('#pgrLines'),
rowNum: 10,
rowList: [5, 10, 20, 50],
sortname: 'Group',
sortorder: "desc",
viewrecords: true,
caption: 'Core Group Lines',
onSelectRow: function(id) {
$('#tblCoreGroupLines').editRow(id, true);
lastsel = id;
},
afterSubmit: function(response, postdata) {
alert('got here');
},
postData: { craId: $('#CraId').val() }
});
我試着將事件定義爲navControl的一部分,但這也不起作用。在線編輯工作正常 - POST成功並返回結果,它從來沒有遇到應該綁定到它的事件。我已經嘗試了所有與數量字段更改相關的事件,但都沒有工作。
我在正確的地方定義了事件嗎?我在網格上丟失了一個屬性嗎?
我認爲你是在正確的軌道上。但是,editRow語句曾經有兩個參數.editRow(id,true)。布爾型「真」參數發生了什麼?沒有它,該單元似乎不再提交。 – 2009-09-04 23:15:16
對不起,應該是editGridRow。 – seth 2009-09-04 23:32:30
我希望避免一個彈出框。理想情況下,希望在網格中獲得內聯編輯的行爲。 – 2009-09-04 23:39:29