Extract row index from slickgrid using a unique ce

2019-07-18 04:43发布

    rowname="r1";
    changes[1]["num1"] = "changed";
    grid.invalidateRow(1);
    grid.setCellCssStyles("highlight", changes);

    grid.render();

Is there a way to get the index of a row in slickgrid if I have a cell value of first column which is unique? In the above code I want to use as changes[rowindex]["num1"]="changed" where "num1" is my column name and "r1" is first column cell value.changes["r1"]["num1"]="changed" does not works.

标签: slickgrid
2条回答
神经病院院长
2楼-- · 2019-07-18 05:35

getRowById(id) - Returns the index of a row with a given id

查看更多
smile是对你的礼貌
3楼-- · 2019-07-18 05:43

Do it like this...

for(var i=0; i<grid.getDataLength(); i++){
   if(grid.getData()[i].firstColumnID == 'firstColumnValue'){
       rowIndex = i;
   }
}
查看更多
登录 后发表回答