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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With