【问题标题】:Kendo Mobile ListView not pagingKendo Mobile ListView 不分页
【发布时间】:2014-11-20 17:51:03
【问题描述】:

我正在使用 Kendo Mobile ListView,但我遇到了分页问题,​​显示了第一页,但之后我的 ListView 似乎卡住了,即出现了加载程序,但没有数据添加到我的列表中,我也可以在调试器中看到该数据是从服务器中提取的。这是我的代码:

m_userRoutines: new kendo.data.DataSource({
        serverFiltering: false,
        serverPaging: true,
        pageSize: 20,
        transport: {
            read: {
                url: pub.serverUrl + "api/Statistics/GetAllRoutinesUserHasDone",
                beforeSend: function (req) {
                    //radi uz data type json
                    req.setRequestHeader("Authorization", "Bearer " + app.loginToken);
                },
                dataType: "json"
            }
        },
        requestEnd: function (e) {
            console.log("user routines loaded", e.response);
        },
        schema: {
            data: function (data) {
                return data;
            },
            total: function (data) {

                return m_userWorkouts.get("workoutsCount");
            }
        }
    }),

【问题讨论】:

    标签: javascript kendo-ui kendo-mobile


    【解决方案1】:

    根据 Kendo Mobile 文档,我相信我找到了答案:

    为了平滑滚动,页面大小不应该 太低了。例如,如果页面上有 5 个项目可见,则至少 需要 15 个物理 DOM 元素,这意味着 DataSource 页面大小应为 30 或更大。

    我的页面大小的问题是它太小了,当我将 pageSize 设置为 60 时一切正常 :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-29
      • 2013-07-31
      相关资源
      最近更新 更多