Kendo UI 网格设置页面/转到页面 (JSP)
Kendo UI Grid set Page / goto Page (JSP)
我对 kendo 网格和设置初始页面有疑问。
初始情况:
我有一个包含许多条目的网格,其中一个是正确的。在哪个页面上,这个条目是我不知道的。
我尝试过的:
在数据绑定事件中,我确定了它所在页面上的项目(对象)(遍历数据源)。在此之后我想设置初始页面,但是如果我使用 dataSource.page(index) javscript 显示错误 -> "too much recursion".
在哪里设置初始页面?
我正在使用 JSP 和 Jquery
感谢您的帮助。
解决方法:
dataBound: function() {
var newPageIndex = calculatePageIndex();
if ( newPageIndex != this.dataSource.page() ) {
this.dataSource.page(newPageIndex);
}}
如果将数据绑定绑定到 js 函数:
<kendo:grid name="grid" dataBound="bound" >
</kendo:grid>
function bound(e){
//find on which page the item/object is
var index = calculatePageIndex();
if ( index != e.sender.dataSource.page() ) {
e.sender.dataSource.page(index);
}
}
我对 kendo 网格和设置初始页面有疑问。
初始情况:
我有一个包含许多条目的网格,其中一个是正确的。在哪个页面上,这个条目是我不知道的。
我尝试过的:
在数据绑定事件中,我确定了它所在页面上的项目(对象)(遍历数据源)。在此之后我想设置初始页面,但是如果我使用 dataSource.page(index) javscript 显示错误 -> "too much recursion".
在哪里设置初始页面?
我正在使用 JSP 和 Jquery
感谢您的帮助。
解决方法:
dataBound: function() {
var newPageIndex = calculatePageIndex();
if ( newPageIndex != this.dataSource.page() ) {
this.dataSource.page(newPageIndex);
}}
如果将数据绑定绑定到 js 函数:
<kendo:grid name="grid" dataBound="bound" >
</kendo:grid>
function bound(e){
//find on which page the item/object is
var index = calculatePageIndex();
if ( index != e.sender.dataSource.page() ) {
e.sender.dataSource.page(index);
}
}