最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Set up JQGrid so all rows are editable? - Stack Overflow

programmeradmin8浏览0评论

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.

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.

Share Improve this question edited Sep 12, 2013 at 13:18 Justin Ethier 134k52 gold badges232 silver badges287 bronze badges asked Dec 14, 2009 at 15:27 Herb CaudillHerb Caudill 50k40 gold badges127 silver badges178 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 7

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 bees editable. Thus if your grid has a scrollbar the grid will visibly scroll through the rows one-at-a-time.

发布评论

评论列表(0)

  1. 暂无评论