Reputation: 111
How to know when a Kendo grid row is in Edit mode without using grid edit event?
var tanquesGrid = $(".tanques").data("kendoGrid");
tanquesGrid.element.delegate("tbody>tr", "dblclick", function () {
var selectedItem = tanquesGrid.dataItem(tanquesGrid.select());
if (hasWriteAccess && isClosed == false && selectedItem.EquipmentHistoricID != '')
tanquesGrid.editRow($(this));
});
The problem is that when row is in inline edit mode and I double click on it, edit mode disappear, this way (code above) I resolve this in new row where the id ! = '' but when edit an existing row the problem persist.
any ideas??
Sorry about my english
Upvotes: 7
Views: 12229
Reputation: 81
if ( $('#grid').find('.k-grid-edit-row').length ) {
//grid is not in edit mode
} else {
//grid is in edit mode
grid.editRow($(this));
}
Upvotes: 7
Reputation: 636
$('#myGrid').find('.k-grid-edit-row');
When the grid is in edit mode, the editing row has a class of "k-grid-edit-row".
This jquery statement will look for a row with the edit mode class within the table of id = "myGrid".
Upvotes: 2
Reputation: 906
It's not in the published API but the grid has a property "editable" which will be non-null when in edit mode.
Upvotes: 5