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

Grid Detail Template with checkbox issue

1 Answer 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gonzalo
Top achievements
Rank 1
Gonzalo asked on 29 May 2014, 02:39 PM
Hi, I have a grid with a detail template that has a checkbox with a databinding and whenever I mark it as checked, the detail template collapses.
Here's an example of the behavior: http://jsfiddle.net/5MU4r/46/

How can I prevent this behavior?
Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 31 May 2014, 11:11 AM
Hello Gonzalo, 

By default when a field of the dataSource is changed and the grid is not in edit mode, the grid will redraw itself to show the changes and therefore the detail will be collapsed. It is possible to prevent the grid from rebinding when a the value is changed by preventing the default action in the dataBinding event e.g.
var ds = new kendo.data.DataSource({
    data: [
      { name: "Joe", human: true },
      { name: "Sally", human: true },
      { name: "Bill", human: true }
    ],
    change: function (e) {
        if (e.action == "itemchange") {
            scholarGrid.one("dataBinding", function (e) {
                e.preventDefault();
            });
        }
    }
});
but note that in this case, the column cell content will not be automatically updated.



Regards,
Daniel
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Gonzalo
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Share this question
or