I'd like to make a JQGrid where all rows are editable (in-line) all the time. What would be the preferred approach to doing this? I'm thinking I'll need to just iterate through the rows and call grid.editRow(id, true)
on each one; but at this point I haven't even figured out how to get access to a collection of rows in order to do that.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can loop through all of the rows by retrieving a list of all ID's for each row in the grid. Then just loop through the list:
var ids = grid.getDataIDs();
for (var i = 0; i < ids.length; i++) {
grid.editRow(ids[i], true);
};
You can probably call editRow to make the rows editable, however be aware that internally, editRow will set focus to each row as it becomes editable. Thus if your grid has a scrollbar the grid will visibly scroll through the rows one-at-a-time.