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

Expand detailview on row select

2 Answers 518 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 31 Jul 2015, 11:06 AM

In our grid we want to expand the detailview when the user selects a row.

Which works fine. The Selectable property of the grid is set to true and the selectmode to row. The onchange eventhandler is set to the function below

When the grid is clicked it handles the expansion or colapsing:

 function kendoGridChange(e) {
    var row = this.select();
    if (row != null) {
        if (row.next(".k-detail-row").is(":visible")) {
            e.sender.collapseRow(row);
        } else {
            e.sender.expandRow(row);
        }
    }
}

 

This works fine.

But: when the user clicks the expand button itself the onchange event is also fired. Which leads to the expansion toggle. After that the default expansion behaviour is fired again. Which leads to a second toggle. Which results is no change.

We have tried in several ways to prevent this happening

  • Examine the incoming event and its sender. There seems to be no way to find out which element was clicked. The expand button or another element in the grid.
  • Fire preventdefault, stopPropagation, stopImmdeatePropagation and the like. 
  • Attach a clickhandler to the expand-button.

None of this has solved the issue. Anybody know a way out ?

It worked fine in the MVC grid.

 

Peter


  

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 04 Aug 2015, 08:40 AM
Hello Peter,

I have tested the scenario that you are describing, but everything seems to work correctly on my end. Can you please take a look at the following dojo example and see what differs in your scenario:
I am looking forward to your reply.


Regards,
Konstantin Dikov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Peter
Top achievements
Rank 1
answered on 04 Aug 2015, 03:16 PM

Updating Kendo to the latest version made it work on my machine to :)

Sorry for not checking that beforehand..

Peter

Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Peter
Top achievements
Rank 1
Share this question
or