Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set up JQGrid so all rows are editable?

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.

like image 957
Herb Caudill Avatar asked Dec 14 '09 15:12

Herb Caudill


1 Answers

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.

like image 186
Justin Ethier Avatar answered Oct 13 '22 19:10

Justin Ethier