How to update value of data in jqgrid

前端 未结 3 1867
清歌不尽
清歌不尽 2020-11-28 12:37

I\'m trying to update a cell in jqgrid permanently upon loading. I know I can use setCell but that only updates the value for that page. If I come back to the

3条回答
  •  孤街浪徒
    2020-11-28 13:29

    For all who came here from google, here is an updated answer!

    important is the index, which you can get by calling getInd-Method. Because rowID != index of localRowData. (eq. rowId: jqg204, Index: 5)

    EDIT: if set "key : true" in colmodel you can set your own rowId (diffrent from my example "jqg###", usually a PK from a database table)

    var ind = myGrid.getInd(rowId);
    var localRowData  = myGrid.jqGrid('getLocalRow', ind);
    localRowData.myColumn = newValue;
    

    hope that helps!

提交回复
热议问题