无法在分页 dojo 增强网格上调用函数

编程入门 行业动态 更新时间:2024-10-24 09:30:36
本文介绍了无法在分页 dojo 增强网格上调用函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了所有可能的方法,但没有奏效.当我移动到 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);

你的方法:

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

请注意这段代码,因为如果他们更改分页器 html 元素的类,它会中断

你真的很执着!

这篇关于无法在分页 dojo 增强网格上调用函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-03-26 23:33:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/670293.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:分页   网格   函数   dojo

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!