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

Prevent detail button to select row

3 Answers 446 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pascal
Top achievements
Rank 1
Pascal asked on 07 Feb 2012, 11:24 PM
I have a grid with row selection and detail for each rows, ex:

var grid = $('#myTable').kendoGrid({
   selectable: "row",
   detailInit: function() { /* load detail items with json ajax request */ },
   change: function() {.... }
}).data('kendoGrid');

When I click on the button that shows the details, the change event is also triggered. Is there a way to prevent that?

3 Answers, 1 is accepted

Sort by
0
Nikolay Rusev
Telerik team
answered on 09 Feb 2012, 11:00 AM
Hello Pascal,

The selection of the grid cannot be prevented. You can easily modify the beahvior as shown on the jsFiddle bellow:

http://jsfiddle.net/rusev/HrfsV/

All the best,
Nikolay Rusev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Basem
Top achievements
Rank 1
answered on 21 May 2012, 08:15 PM
Since I had a change event in my grid, I needed to handle this more precisely. So I ended up testing if the click actually came from the hierarchy link or was a real row select:

function isHierarchyClick() {
  return $(event.target).parent().hasClass('k-hierarchy-cell');
}
 
function onGridChange(e) {
        if (!isHierarchyClick()) {
            //DO SELECT ACTIONS HERE
        }
}

I am testing if the triggered event came from the hierarchy link, which I am assuming is a direct child of ('.k-hierarchy-cell'). This would be a nice property off the grid called "selectOnDetail: false". I hope this helps.
0
jwize
Top achievements
Rank 1
answered on 17 Sep 2013, 05:42 AM
sure but doesn't work in IE or Firefox
Tags
Grid
Asked by
Pascal
Top achievements
Rank 1
Answers by
Nikolay Rusev
Telerik team
Basem
Top achievements
Rank 1
jwize
Top achievements
Rank 1
Share this question
or