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

How to detect Scroll event

4 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
heesu
Top achievements
Rank 1
heesu asked on 04 Jun 2020, 08:41 AM

Is there any way to detect mouse scroll event in Kendo Grid??

 

I read API document and tried the code below 

But nothing worked.

-----------------------------------------------------------------------

mounted () {

  document.addEventListener('click', someHandler)

 

     

}

-----------------------------------------------------------------------

 

Adding 'wheel' event works well inside Kendo Grid. However 'click' 

4 Answers, 1 is accepted

Sort by
0
heesu
Top achievements
Rank 1
answered on 04 Jun 2020, 08:44 AM
adding 'wheel' event works well. However, not 'click' event.
0
Veselin Tsvetanov
Telerik team
answered on 08 Jun 2020, 06:30 AM

Hi,

I would recommend you to attach the Vue v-on:click event on the Grid parent element. Here is a StackBlitz sample implementing the above suggestion:

https://stackblitz.com/edit/ocb3es?file=index.js

Regards,
Veselin Tsvetanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
heesu
Top achievements
Rank 1
answered on 10 Jun 2020, 07:55 AM
Oops, I have a mistake on this post. Kendo Grid ignores adding 'scroll' event dynamically. Not, 'click' event. How can I add 'scroll' event inside kendo grid??
0
Veselin Tsvetanov
Telerik team
answered on 12 Jun 2020, 05:07 AM

Hello,

Thank you for the additional clarifications provided on the above. Here you could find a modified version of the StackBlitz sample poaching a scroll event handler to the Grid content element:

https://stackblitz.com/edit/ocb3es?file=index.js

I have attached that handler in the mounted function of the Vue component:

    mounted: function() {
      var scrollContainer = document.getElementsByClassName("k-grid-content")[0];

      scrollContainer.addEventListener('scroll', this.onScroll);
    },

Regards,
Veselin Tsvetanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
Grid
Asked by
heesu
Top achievements
Rank 1
Answers by
heesu
Top achievements
Rank 1
Veselin Tsvetanov
Telerik team
Share this question
or