Reload single jqGrid row?

余生长醉 提交于 2019-11-30 05:24:43

问题


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.


回答1:


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.




回答2:


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);
}


来源:https://stackoverflow.com/questions/3786445/reload-single-jqgrid-row

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!