javascript - 使用 KendoUI 的 Listview 控件进行服务器端分页

标签 javascript jquery angularjs kendo-ui kendo-listview

我正在尝试使用 KendoUI 的 ListView 控件进行服务器端分页。但问题是分页器控件不显示页面的链接。这是我的代码:

var dataSource = new kendo.data.DataSource({
                serverPaging: true,
                pageSize: 2,

                schema: {
                    id: "Id",
                    data: "Results",
                    total: "total"                            
                    }
                },

                transport: {
                    read: function (options) {
                        oThis.GetDataFromServer(options);
                    }
                }
            });

$('#listcontent').kendoListView({
                template: kendo.template('<div><table > \
                                          <tr><td style = "\\padding:8px;" ><b>#:data.Name#</b></td ></tr> \
                                          <tr><td style="\\padding:8px;">#:data.Description#</td > \
                                         <td><a href="#:data.productdetailurl(data.SourceProductVersionId,"catalogueitem")#">View Detail</a ></td> \
                                          </tr></table></div>'),
                dataSource: dataSource,
                selectable: true
            });

            //render kendo listview pager
            $('#listpager').kendoPager({
                datasource: dataSource 
            });

总计字段包含正确的记录数。这在 Grid 中工作得很好,所以不确定 Listview 有什么问题。

最佳答案

我认为你遗漏了pageable: true

$('#listcontent').kendoListView({
            template: kendo.template('<div><table > \
                                      <tr><td style = "\\padding:8px;" ><b>#:data.Name#</b></td ></tr> \
                                      <tr><td style="\\padding:8px;">#:data.Description#</td > \
                                     <td><a href="#:data.productdetailurl(data.SourceProductVersionId,"catalogueitem")#">View Detail</a ></td> \
                                      </tr></table></div>'),
            dataSource: dataSource,
            selectable: true,
            pageable: true
        });

关于javascript - 使用 KendoUI 的 Listview 控件进行服务器端分页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23136224/

相关文章:

javascript - Azure 表存储返回查询结果

javascript - 获取最后一个破折号和最后一个点之间的字符串

javascript - 单击添加行并从列表中选择1个选项时,我想获得总和值吗?

javascript - Websocket 与 AngularJS/Asp.net

javascript - 将 Angular Bootstrap Modal 与外部 Controller 一起使用

javascript - 使用 angularjs 从 json 打印菜单?

javascript - 脚本标签在主体内部起作用,但在外部不起作用

javascript - 在 heroku 部署应用程序时,我应该在 baseURL 中写入什么?

javascript - 用于调试 JavaScript 的工具综述

Jquery查找替换多个单词