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

Double Click on row

3 Answers 567 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Giuseppe
Top achievements
Rank 1
Giuseppe asked on 21 Nov 2020, 11:48 AM

Hi all, 

i'm struggling to achive a simple task: double click on a row to call a method. How can i do that? 

what i'm expecting is simple:

 

<Grid
     :data-items="gridResult"
     :columns="columnsToDisplay"
     :resizable="true"
     :pageable="pageAble"
     :pageSize="pageSize"
     @dblclick="callMyMethodForDoubleClick"         
     >
</Grid>

something like this

3 Answers, 1 is accepted

Sort by
0
Accepted
Petar
Telerik team
answered on 25 Nov 2020, 10:33 AM

Hi Giuseppe,

Neither the Native Grid nor the Wrapper Grid has a built-in double-click event. Here are examples of how you can implement a double-click logic:

onRowClick(arg) {
  this.clicks++;
  if (this.clicks === 1) {
    // single click
    setTimeout(() => {
      this.clicks = 0;
    }, 500);
  } else {
    clearTimeout(this.timer);
    this.handleDblClick(arg);
    this.clicks = 0;
  }
},
handleDblClick(arg) {
  console.log("double click");
}
methods: {
  onDataBound: function(e) {
    let grid = e.sender;
    grid.tbody.find("tr").dblclick(function(e) {
      let dataItem = grid.dataItem(this);
      console.log(dataItem);
    });
  }
}

I hope the above will help you implement what you need in your application.

Regards,
Petar
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Giuseppe
Top achievements
Rank 1
answered on 03 Dec 2020, 05:28 PM
Thanks a lot Petar
0
Plamen
Telerik team
answered on 08 Dec 2020, 08:17 AM

Hello,

Just to let you know - with the latest version 1.2.0 we have added a 'rowdblclick' event to the Kendo Native Grid component for Vue - https://stackblitz.com/edit/pae8ab-2kmjjl?file=src/main.vue.

Regards,
Plamen
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Grid
Asked by
Giuseppe
Top achievements
Rank 1
Answers by
Petar
Telerik team
Giuseppe
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or