开发者

Reload single jqGrid row?

How can you reload a SINGLE jqGrid row?

We know how to reload the entire 开发者_如何学运维grid - but we just want to update a single row when we know that the data in the row has changed.


If you hold the data on the server and your server support filtering of data (single of advance searching) then you can use the same url which you use in jqGrid for your manual jQuery.ajax calling. You should set only the filter to id equal to the row which you need to refresh. On successful response from the server you can use setRowData or delRowData to update the row contain or to delete the row.


You will need to update the tr id as well, otherwise it will save it multiple times on next edit.

function afterSave(p,p2) { 
    $('#mygrid').setRowData(lastSel,{'id':newId});
    $('#'+lastSel).attr("id",newId);
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜