问题描述
我尝试了所有可能的方法,但没有奏效.当我移动到 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:关键词]
发布评论