2

I tried all the possible ways but it's not working. I want to call a function when I move to another page in a dojo dataGrid (during pagination). I tried the below code, but it's not working...

method one:

nextPage = function(src) {
    alert("going");
};

grid.startup();

method two:

  grid.on("nextPage", function(evt){

 alert("next");
  }, true);

method thee:

            grid.pagination.plugin.nextPage = function(src) {
                 alert("here");
            };

None of these methods are working. Please give sample code which will be called by clicking on any page numbers to move to another page...

Jess
  • 23,901
  • 21
  • 124
  • 145
kumar
  • 708
  • 4
  • 15
  • 39
  • Documentation for this plugin: http://dojotoolkit.org/reference-guide/1.8/dojox/grid/EnhancedGrid/plugins/Pagination.html. It does not show any events you can connect to, but I'll keep looking. – Jess Apr 15 '13 at 16:17
  • See this question: http://stackoverflow.com/questions/15269985/dojo-enhanced-grid-with-pagination-need-to-access-number-of-rows-in-the-page. They were able to implement an enhanced grid with an event handler for `onclick`. – Jess Apr 15 '13 at 16:25

1 Answers1

0

Here is a dirty solution with a working jsfiddle:

http://jsfiddle.net/KbZSC/

Main code:

    grid.startup();

    var paginatorElements = dojo.query(".dojoxGridInactiveSwitch");
    paginatorElements.push(dojo.query(".dojoxGridInactived"));
    paginatorElements.push(dojo.query(".dojoxGridWardButton"));

    dojo.forEach(paginatorElements, function(element, i){
       dojo.on(element,"click",function(e){
       grid.selection.deselectAll();
       });
});

I am getting all elements involved in the pagination process and add an onclick event to each of them, which deselects all elements in the grid using

grid.selection.deselectAll();

from the other answer i posted for you.

Please be cautious with this code, as it will break if they change the classes for the paginator html elements !

You are really persistent !

Lucian Depold
  • 1,999
  • 2
  • 14
  • 25