Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

198
Views
Cannot subscribe on slickgrid scroll event

I'm using slickgrid as container for data, and trying to subscribe on it's onscroll event as of described in documentation, i.e.

task_list.onscroll.subscribe(function(e, args) {
    console.log('scrolling occured');
});

Actually, I'm trying to do other processing afterwards, which is translating contents of the web page. The content is not fully translated, so I need to translate each time I scroll the page. However I get the message

Uncaught TypeError: Cannot read properties of undefined (reading 'subscribe')

How can I troubleshoot this error and find out why I get it?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

There's a few small errors in your code, first the event names are camelCase so it should be onScroll and second if you want to subscribe to SlickGrid events then you need to use the grid object

grid.onScroll.subscribe(function(e, args) {
 // ...
});

and don't forget to unsubscribe when leaving the page because you'll have quite a leak with the onScroll. I prefer to use the Slick EventHandler since it has an easier unsubscribeAll method that I can use when destroying/leaving the page

var eventHandler = new Slick.EventHandler();
var grid = new Slick.Grid("#myGrid", dataView, columns, options);

function something() {  
  eventHandler.subscribe(grid.onScroll, function(e, args) {
    // ...
  });
}

function destroy() {
  eventHandler.unsubscribeAll();
}

Hopefully there's no error in my code but just to let you know I wrote by memory here so please double-check the code and look at the multiple SlickGrid Examples which all have easy code access

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!