2012-08-06 50 views
1

我在我的商店有以下内容。请注意,限制设置为10.我可以在萤火虫上看到返回10条记录。我的问题是,我的网格分页似乎没有正确的“页面”值。设置在extjs商店的限制不会更新页面变量

即我有11条记录共(这应该是2页)

proxy:{ 
    type:'ajax', 
    api:{ 
     read: '/CutterHistory/Read/', 
     update:'/CutterHistory/Update', 
     create:'/CutterHistory/Update', 
     destroy:'/CutterHistory/Remove' 
    }, 
    reader:{ 
     type:'json', 
     root:'CutterHistories', 
     successProperty:'success', 
     totalProperty:'Total' 
    }, 
    writer:{ 
     type:'json', 
     allowSingle:true 
    }, 
    simpleSortMode: true, 
    extraParams : { 
     'sort' : sortBy, 
     'search' : search, 
     'limit' : 10, 
     'destroyed' : destroyed 
    } 
}, 

enter image description here

和我的格子

enter image description here

+3

我敢肯定,你不需要包含'sort'和'limit'作为额外的参数。如果您有分页工具栏,则应该简单地将[pageSize](http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Store-cfg-pageSize)设置为你的商店和商店将照顾这一切。 – Izhaki 2012-08-06 13:12:06

+0

现货。谢谢 :) – frosty 2012-08-06 13:36:14

回答

4

我敢肯定你不” t需要包括排序和限制作为额外的参数。如果你有一个分页工具栏,你应该简单地在你的商店中设置pageSize,商店将处理所有这些