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

Cancelling targeted cell only in editable: incell

1 Answer 20 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Artur
Top achievements
Rank 1
Artur asked on 04 Aug 2015, 12:42 PM

I have a grid editable 'incell'. One of the columns is displayed as checkbox at all times, the others are static, but their editors are set to kendoComboBox.

The checkbox column is bound so that the current ':checked" state is applied to the underlying dataItem, like so:

$(".checkbox").unbind("change");
$(".checkbox").bind("change", function (e) {
    var $row = $(e.target).closest("tr"),
        di = grid.dataItem($row),  // grid is a ref to kendoGrid defined
        state = $(e.target).is(':checked');
    console.group('change', $row, di.uid);
    console.log(di);
    di.set('group', state);
    console.log(di);
    console.groupEnd();
});‚Äč

Now the problem I'm facing is that when I select an item in a ComboBox column and hit escape, the ComboBox choice is cancelled but so is the checkbox state. Even though the state has been applied, and even though the dataSource.hasChanges returns false.

What could I do to make escape cancel the targeted cell only? I wish we could have cancelCell method (equivalent of cancelRow in inline mode).

Thx, Artur

1 Answer, 1 is accepted

Sort by
0
Artur
Top achievements
Rank 1
answered on 04 Aug 2015, 01:16 PM
Shame on me - overlooked optional boolean parameter g.closeCell(true);
Tags
Grid
Asked by
Artur
Top achievements
Rank 1
Answers by
Artur
Top achievements
Rank 1
Share this question
or