This is a migrated thread and some comments may be shown as answers.

Expand details view upon editing

1 Answer 64 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Makoto
Top achievements
Rank 1
Makoto asked on 08 Dec 2010, 09:24 PM
I have a grid that has a details view.  I'd like to make it so that when they click on edit, the row's details view will expand.

What I have tried is something like this:

.ClientEvents(events => events.OnEdit("grid_onEdit"))

And the script that handles the event:
function grid_onEdit(e) {
    var grid = $(e.target).data('tGrid');
    var row = $(e.form).parent().parent();
    grid.expandRow(row);
}

The form property was the only property that I could see having anything specific to the row being edited, and when I evaluate the row variable, it does match up with the row. 

What would be the proper way of doing what I'm trying to accomplish?

1 Answer, 1 is accepted

Sort by
0
Makoto
Top achievements
Rank 1
answered on 08 Dec 2010, 10:18 PM
Figured it out.  When editing, it uses a different row that needs to be expanded.

To get the proper row and expand it, I did the following:
function grid_onEdit(e) {
       var grid = $(e.target).data('tGrid');
       var row = $(e.form).find("tr");
       grid.expandRow(row[0]);
   }
Tags
Grid
Asked by
Makoto
Top achievements
Rank 1
Answers by
Makoto
Top achievements
Rank 1
Share this question
or