jqGrid: how to update row id if primary key columns was edited

前端 未结 2 1859
失恋的感觉
失恋的感觉 2021-01-25 23:37

Primary key values are used as row ids in json data returned from server. If primary key value is edited and saved two times, second save causes error since jqGrid passes origin

2条回答
  •  孤独总比滥情好
    2021-01-26 00:42

    The rowid is nothing more as the value of id attribute of the corresponding element of the grid. So to change the rowid oldRowid to newRowid you should do something like the following:

    $("#" + oldRowid).attr("id", newRowid);
    

提交回复
热议问题