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

10,770

Solution 1

          if ( $('#grid').find('.k-grid-edit-row').length ) {
            //grid is not in edit mode          
           } else {
                //grid is in edit mode
                grid.editRow($(this));
            }

Solution 2

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

Solution 3

    $('#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".

Share:
10,770
yovanys
Author by

yovanys

Updated on June 14, 2022

Comments

  • yovanys
    yovanys about 2 years

    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