4 Replies Latest reply on Sep 17, 2009 9:15 AM by Nick Belaevski

    How to get new datascroller page number in javascript?

    Anton Lisovenko Newbie

      Hello. I'm introducing RSH history management and trying to manage back button for datascroller. There are some javascript problems.

      The simple idea is: on page change event I want to write new page number to java history. The best way would be this one:

      #{rich:component('sc1')}.onpagechange = function() {
       var i = ..... /// HOW TO GET JUST CLICKED PAGE NUMBER??
       dhtmlHistory.add("page:" + i, "");
      }
      

      actually I can use "onclick" js event for each "td" element in datascroller, but this doesn't fit situations, when this element is disabled and should not produce any events. "onpagechange" element is very good and smart, but still cannot find just clicked page using javascript :((

      May be there is some way to set callbacks to onpagechange and other events which would get the new page var?

      Thank you.