Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know when a Kendo grid row is in Edit mode

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

like image 441
yovanys Avatar asked Jan 29 '14 04:01

yovanys


2 Answers

          if ( $('#grid').find('.k-grid-edit-row').length ) {
            //grid is not in edit mode          
           } else {
                //grid is in edit mode
                grid.editRow($(this));
            }
like image 174
abuumar Avatar answered Nov 13 '22 10:11

abuumar


It's not in the published API but the grid has a property "editable" which will be non-null when in edit mode.

like image 26
moomoo Avatar answered Nov 13 '22 10:11

moomoo