Matt Weston
Matt Weston

Reputation: 21

Kendo UI Grid edit on row click instead of edit button click

Does anyone know of a way to trigger the editing of a row just by clicking the row?

I would like to see the same functionality that I see when I click an edit command button, but triggered by selecting the row.

Upvotes: 1

Views: 4249

Answers (2)

Michael Johnson
Michael Johnson

Reputation: 2307

I know this is an old question, but I just had need for a solution and this is what worked for me. I wanted to use double-click, but the click event should also work.

var grid = $('#grid').data('kendoGrid');
$('#grid .k-grid-content table').on(
  'dblclick',
  'tr',
  function () { grid.editRow($(this)); }
);

The selector ("#grid .k-grid-content table") works for my current configuration (mainly I have virtual scrolling turned on) and so may need to be adjusted for your specific situation.

Upvotes: 0

JFM
JFM

Reputation: 753

You can add this to your change event for your grid:

myGrid.setOptions({
            editable: {
                mode: "inline"
            },
            change: function(){
                  this.editRow(this.select());
            }
});

Upvotes: 1

Related Questions