當我做jQuery的jqGrid的一些測試,但有問題:jqGrid的錯誤刪除
jQuery("#navgrid").jqGrid(
"navGrid",
"#pagernav",
{}, //options
{}, // edit options
{}, // add options
{
afterSubmit : function(response, postdata)
{
if(response.responseText == 'success')
{
console.log(postdata);
alert('success and data should be changed')
console.log(postdata.id);
jQuery("#navgrid").delRowData(postdata.id);
}
else
{
alert('failed and data should not be changed');
}
return true;
},
reloadAfterSubmit: true
}, // del options
{} // search options
);
我做兩分的console.log對於螢火蟲:
postdata => Object { oper="del", id="29"}
postdata.id => 29
後來我有錯誤這樣的我的螢火蟲:
postdata.split is not a function
toarr = postdata.split(",");
我想我已經遵循了這一方法: http://www.trirand.com/jqgridwiki/doku.php?id=wiki:methods
我看到最新的jqGrid和jQuery 1.6.4和1.7.1都有同樣的結果。 – macca1 2012-01-05 19:17:32