【发布时间】:2013-02-03 09:24:24
【问题描述】:
并提前感谢您在此问题上的帮助。
我有一个 extjs 4.1 网格,填充了从服务器加载的 json。分页是远程的,每个 25 个项目的块都从服务器正确地作为有效的 json 提供,并且在 totalProperty 中具有正确的值。就加载和分页而言,一切功能正常,分页栏中没有页码。 它看起来像这样。 好的...我不允许发布图片...所以这是一个链接 it looks like this
这里是相关代码。如果有助于解决问题,我可以发布其他代码。
var theStore = Ext.create('Ext.data.Store',
{
model: 'SearchResult',
pageSize: 25,
remoteSort: true,
proxy:
{
type: 'ajax',
url: '/Search/SubmitSimpleQuery',
reader:
{
type: 'json',
root: 'Results',
totalProperty: 'totalHits'
},
extraParams:
{
searchText: theSearchText,
beginDate: theBeginDate,
endDate:theEndDate,
collectionMatch:theCollection
}
}
});
theStore.load();
var grid = Ext.create('Ext.grid.Panel',
{
store: theStore,
width: '100%',
height: '100%',
columns:
[
{
text: 'Title',
dataIndex: 'title',
width: '60%'
},
{
text: 'Published Date',
dataIndex: 'pubDate_ymd',
renderer: renderDate
},
{
text: 'Released Date',
dataIndex: 'releaseDate_ymd',
renderer: renderDate
},
{
text: 'From',
dataIndex: 'from',
hidden: true
},
{
text: 'To',
dataIndex: 'to',
hidden: true
}
],
dockedItems: [
{
xtype: 'pagingtoolbar',
dock: 'bottom',
store: theStore,
displayInfo: true,
displayMsg: 'Displaying results {0} - {1} of {2}',
emptyMsg: 'No results'
}]
});
Ext.create('Ext.panel.Panel',
{
bodyPadding:25,
width:'100%',
renderTo:Ext.getBody(),
items:[
grid
]
});
totalproperty 正确地通过他的 json 进入 - 例如 108 导致 5 页。所有寻呼工作。当分页到第 2 页时,page:2 , start:25, limit: 25
全部传递给服务器,所以 ext 知道它是什么页面,但它没有进入当前页面框。然后我需要将该页面值设置为代理或存储上的属性吗?
我被难住了,我已经用头撞这个有一段时间了。
谢谢。
顺便说一句, 这是一个类似的问题 ExtJS grid panel not showing page number 但它(显然?)已修复将分页栏添加到网格上的停靠编辑项,正如您在上面看到的那样。
【问题讨论】:
标签: extjs grid paging extjs4.1