无法在处理onPaging事件的函数中获取rowNum [英] Trouble with getting rowNum inside the function that handles onPaging event
本文介绍了无法在处理onPaging事件的函数中获取rowNum的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我在分页组合框中更改rowNum时(请参见下文)
When I change the rowNum in paging combobox (see below)
我想找出选择了哪个号码,所以我决定使用下一个方法:
I want to find out which number was selected so I have decided to use the next approach:
onPaging : function(pgButton) {
onPagingHandler(pgButton);
}
...
function onPagingHandler(pgButton) {
if (pgButton != "records"){
return;
}
alert($("#gridId").getGridParam('rowNum'));
}
问题是当我在组合框中选择说 10 时,现在我选择说 30 ,在事件处理程序中,此代码$("#gridId").getGridParam('rowNum')
仍然给我以前的提示值( 10 ).为什么没有给我 30 ,我该如何解决?
The issue is when I got say 10 selected in the combobox and now I am selecting say 30, inside the event handler this code $("#gridId").getGridParam('rowNum')
still give me previous value (which is 10). Why doesn't it give me 30 and how can I fix it?
推荐答案
您必须直接从select中获取值:
You have to get the value directly from the select:
onPaging : function(pgButton) {
if (pgButton != "records"){
return;
}
var newRowNum = $(".ui-pg-selbox", this.p.pager).val();
}
这篇关于无法在处理onPaging事件的函数中获取rowNum的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文