单击下一个按钮时无法获取当前页面作为参数 [英] Can't get the current page as parameter when the next button is clicked
本文介绍了单击下一个按钮时无法获取当前页面作为参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
点击下一个按钮时,我试图将页码作为参数.
I'm trying to get the page number as a parameter when the next button is clicked.
我正在尝试使用以下代码来实现它:
I'm trying to achieve it using the below code:
onPaging: function(pgButton) {
if(pgButton == "next") {
window.alert("next clicked! \n page: " +
$('#userlist').getGridParam('page'));
}
}
没有成功(使用上面的代码,下一步按钮不起作用).我确定我缺少真正简单的东西.网格代码中是否有特定的地方应该放置我的代码?
without any success(with the above code the next button is not working). I'm sure that I'm missing something really simple. Is there a specific place in the grid code, where I should place my code?
推荐答案
尝试一下
onPaging: function(pgButton){ if(pgButton=="next_your_paging_tool_id"){ window.alert("next clicked! \n page: " + $('#userlist').getGridParam('page')); } },
在if条件中,如所发布的代码所示,在分页工具ID的ID后面加上_
append the ID of your paging tool ID with a _ in your if condition as in the code posted
这篇关于单击下一个按钮时无法获取当前页面作为参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文