この問題についてご支援いただきありがとうございます。
サーバーからロードされたjsonが取り込まれたextjs 4.1 grid があります。ページングはリモートで行われ、25 個のアイテムの各ハンクは、totalProperty に適切な値を持つ有効な json としてサーバーから適切に提供されます。読み込みとページングに関する限り、すべてが機能的に正常に機能します。ページング バーにページ番号がありません。このように見えます。わかりました...私は画像を投稿することを許可されていません...だから、 これはこのようなリンクです
ここに関連するコードがあります。トラブルシューティングに役立つ場合は、追加のコードを投稿できます。
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 グリッド パネルにページ番号 が表示されない同様の問題ですが、(どうやら?) グリッド上の Dockeditems にページング バーを追加することで修正されました。