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

Grid event row binding

1 Answer 205 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Thirumurthi
Top achievements
Rank 1
Thirumurthi asked on 05 Apr 2013, 10:25 AM
          I have mapped the double click and keydown event in a dataBound event for a kendo popup grid. I faced some issues which was mentioned below,

1. Binding Doubleclick event for grid row in dataBound event as,
   self.tbody.find("tr").on("dblclick", function (e) {
          if (!$(this).hasClass('k-grid-edit-row')) {
            self.editRow($(this));
          }
        });
    After popup open, while clicking cancel, next time double click not firing for that row.

2. Binding KeyDown event for grid row in dataBound event for deleting the row,
  self.tbody.find("tr").on("keydown", function (e) {
           if (e.keyCode == 46) {
              self.removeRow($(this));
           }
         });
    The delete key event is not firing for the selected row.


Thanks and Regards,
Thirumurthi

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 09 Apr 2013, 07:29 AM
Hi,

 The table rows are updated in certain conditions (e.g. during editing) and the new table row doesn't have the handler bound. Use the following instead:

OLD:

self.tbody.find("tr").on("dblclick"

NEW:

self.tbody.on("dblclick", "tr"

All the best,
Atanas Korchev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Thirumurthi
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or