【问题标题】:Dojo EnhancedGrid Scrolling with JsonRestStore使用 JsonRestStore 进行 Dojo 增强网格滚动
【发布时间】:2013-08-01 03:31:16
【问题描述】:

我正在使用带有 JsonRestStore 的 dojo 1.6 EnhancedGrid,如下面的 sn-p 所示。我有大约 15000 条数据记录。当向下拖动网格的垂直滚动条以进行滚动时,需要很长时间才能使数据在网格中可见。经过一些调试,我注意到单次滚动会向服务器发送 4-5 个 GET 请求。

有没有更好的方法来解决这个问题,或者有没有办法确保只有最后一个 GET 请求被发送到服务器?我能够捕获 onscroll 事件,但不确定如何阻止发送 GET 请求。

store = new dojox.data.JsonRestStore({
    target:"myurl",
    idAttribute: 'id', 
    allowNoTrailingSlash: true});       

mygrid = new dojox.grid.EnhancedGrid({
    id: 'mygrid',
    queryOptions: {ignoreCase: true},
    sortInfo: '3',
    store: store,
    structure: my.grid.structure,
    selectionMode: "extended",
    autoHeight: 12,
    plugins: {indirectSelection: true},
    fastScroll: false
},document.createElement('div'));
dojo.byId("datagrid").appendChild(mygrid.domNode);

// start the grid 
mygrid.startup();

【问题讨论】:

    标签: rest dojo grid


    【解决方案1】:

    如果你有这么多信息要处理,我建议你使用分页插件来增强网格。优点是一次只能加载一定数量的数据记录。

    看看这里:http://dojotoolkit.org/reference-guide/1.8/dojox/grid/EnhancedGrid/plugins/Pagination.html#id2

    问候,米里亚姆

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-02-14
      • 2011-08-14
      • 1970-01-01
      • 2013-12-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多