不能调用分页功能dojo enhancedGrid [英] not able to call a function on pagination dojo enhancedGrid

查看:168
本文介绍了不能调用分页功能dojo enhancedGrid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了所有可能的方式,但它不起作用。
当我在dojo dataGrid中移动到另一个页面(在分页时),我想调用一个函数。我尝试下面的代码,但它不工作...

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...

方法一:

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

grid.startup();

方法二:

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

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

方法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...

推荐答案

这是一个肮脏的解决方案与工作jsfiddle:

Here is a dirty solution with a working jsfiddle:

http:// jsfiddle。 net / KbZSC /

主要代码:

    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();
       });
});

我在分页过程中涉及所有元素,并为每个元素添加一个onclick事件,使用

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.

请谨慎使用此代码,因为如果更改paginator html元素的类别,它将会中断!

你真的坚持!

这篇关于不能调用分页功能dojo enhancedGrid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆