not able to call a function on pagination dojo enhancedGrid

后端 未结 1 1950
广开言路
广开言路 2021-01-22 12:54

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

相关标签:
1条回答
  • 2021-01-22 13:46

    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 !

    0 讨论(0)
提交回复
热议问题