fudaozhenchu@gmail.com
25 May 2009, 4:59 PM
お世話になります。以下のコードでページングを行っております。
load時のlimitとToolbarのpageSizeを20に設定しているのですが、
load時に全件読み込まれてしまい、この状態でページングの「次へ」ボタンを
押しても全件表示されたままで次の20件へ遷移せずに困っております。
恐縮ですが、どこかにコードのミスや足りない記述があればヒントを頂ければ幸いです。
Ext.onReady(function() {
// s.gif設定
Ext.BLANK_IMAGE_URL = "ext/resources/images/default/s.gif";
// クイックチップス初期化
Ext.QuickTips.init();
//Ext.data.JsonReaderオブジェクトの生成
var NotImportedFilesNameReader = new Ext.data.JsonReader({
//全体件数のプロパティ名
totalProperty: "totalCount",
//行データの配列名
root: "array",
//各フィールドの設定
fields: [
{name: "id", type: "int"},
{name: "filesname", type: "string"}
]
});
//Ext.grid.CheckboxSelectionModelオブジェクトの生成
var NotImportedFilesNameCheckbox = new Ext.grid.CheckboxSelectionModel();
//Ext.grid.ColumnModelオブジェクトの生成
var NotImportedFilesNameColumns = new Ext.grid.ColumnModel([
//チェックボックスの表示
NotImportedFilesNameCheckbox,
//フィールド定義
{id: "id", header: "番号", width: 80, dataIndex: "id"},
{id: "filesname", header: "ファイル名", width: 100, dataIndex:
"filesname"}
]);
//Ext.data.Storeオブジェクトの生成
var NotImportedFilesNameDataStore = new Ext.data.Store({
//データ取得元URLの指定
proxy: new Ext.data.HttpProxy({
url: "./feature/notimportedfilesname.php", method: "POST"}),
reader:
NotImportedFilesNameReader
});
//Ext.PagingToolbarオブジェクトの生成
var NotImportedFilesNameToolbar = new Ext.PagingToolbar({
//1ページあたり表示件数
pageSize: 20,
//適用先データ
store: NotImportedFilesNameDataStore,
//メッセージ設定
displayInfo: true,
displayMsg: "{2} 件中の {0} 件から {1} 件までを表示しています。",
emptyMsg: "未取込のデータはありません。",
});
//Ext.grid.GridPanelオブジェクトの生成
var NotImportedFilesNameGrid = new Ext.grid.EditorGridPanel({
//表示するデータ
store: NotImportedFilesNameDataStore,
//フィールド定義
cm: NotImportedFilesNameColumns,
//追加フィールド定義
sm:NotImportedFilesNameCheckbox,
//折り畳み時のアニメーション
animcollapse: true,
//折り畳み初期設定
collapsed: false,
//折り畳みボタンの表示
collapsible: true,
//タイトルバークリックによる折り畳み
titleCollapse: true,
//グリッドの幅
autoWidth: true,
//width: 800,
//グリッドの高さ
//autoHeight: true,
height: 500,
//タイトル
title: "未取込のファイル一覧",
//ID
renderTo: "grid-container",
//編集に必要なクリック数
clicksToEdit: 2,
//ボトムバーの表示
bbar: NotImportedFilesNameToolbar,
//ボタン
buttons: [
{text: "キャンセル", handler: cancel},
{text: "更新",handler:update}
]
});
//データの読み込み(パラメータ指定)
NotImportedFilesNameDataStore.load({params: {start: 0, limit: 20}});
//キャンセル押下時
function cancel() {
NotImportedFilesNameDataStore.reload();
}
//更新押下時
function update() {
Ext.MessageBox.show({
title: "更新ボタン押下",
msg: "更新ボタンが押されました。",
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.INFO
});
}
});
load時のlimitとToolbarのpageSizeを20に設定しているのですが、
load時に全件読み込まれてしまい、この状態でページングの「次へ」ボタンを
押しても全件表示されたままで次の20件へ遷移せずに困っております。
恐縮ですが、どこかにコードのミスや足りない記述があればヒントを頂ければ幸いです。
Ext.onReady(function() {
// s.gif設定
Ext.BLANK_IMAGE_URL = "ext/resources/images/default/s.gif";
// クイックチップス初期化
Ext.QuickTips.init();
//Ext.data.JsonReaderオブジェクトの生成
var NotImportedFilesNameReader = new Ext.data.JsonReader({
//全体件数のプロパティ名
totalProperty: "totalCount",
//行データの配列名
root: "array",
//各フィールドの設定
fields: [
{name: "id", type: "int"},
{name: "filesname", type: "string"}
]
});
//Ext.grid.CheckboxSelectionModelオブジェクトの生成
var NotImportedFilesNameCheckbox = new Ext.grid.CheckboxSelectionModel();
//Ext.grid.ColumnModelオブジェクトの生成
var NotImportedFilesNameColumns = new Ext.grid.ColumnModel([
//チェックボックスの表示
NotImportedFilesNameCheckbox,
//フィールド定義
{id: "id", header: "番号", width: 80, dataIndex: "id"},
{id: "filesname", header: "ファイル名", width: 100, dataIndex:
"filesname"}
]);
//Ext.data.Storeオブジェクトの生成
var NotImportedFilesNameDataStore = new Ext.data.Store({
//データ取得元URLの指定
proxy: new Ext.data.HttpProxy({
url: "./feature/notimportedfilesname.php", method: "POST"}),
reader:
NotImportedFilesNameReader
});
//Ext.PagingToolbarオブジェクトの生成
var NotImportedFilesNameToolbar = new Ext.PagingToolbar({
//1ページあたり表示件数
pageSize: 20,
//適用先データ
store: NotImportedFilesNameDataStore,
//メッセージ設定
displayInfo: true,
displayMsg: "{2} 件中の {0} 件から {1} 件までを表示しています。",
emptyMsg: "未取込のデータはありません。",
});
//Ext.grid.GridPanelオブジェクトの生成
var NotImportedFilesNameGrid = new Ext.grid.EditorGridPanel({
//表示するデータ
store: NotImportedFilesNameDataStore,
//フィールド定義
cm: NotImportedFilesNameColumns,
//追加フィールド定義
sm:NotImportedFilesNameCheckbox,
//折り畳み時のアニメーション
animcollapse: true,
//折り畳み初期設定
collapsed: false,
//折り畳みボタンの表示
collapsible: true,
//タイトルバークリックによる折り畳み
titleCollapse: true,
//グリッドの幅
autoWidth: true,
//width: 800,
//グリッドの高さ
//autoHeight: true,
height: 500,
//タイトル
title: "未取込のファイル一覧",
//ID
renderTo: "grid-container",
//編集に必要なクリック数
clicksToEdit: 2,
//ボトムバーの表示
bbar: NotImportedFilesNameToolbar,
//ボタン
buttons: [
{text: "キャンセル", handler: cancel},
{text: "更新",handler:update}
]
});
//データの読み込み(パラメータ指定)
NotImportedFilesNameDataStore.load({params: {start: 0, limit: 20}});
//キャンセル押下時
function cancel() {
NotImportedFilesNameDataStore.reload();
}
//更新押下時
function update() {
Ext.MessageBox.show({
title: "更新ボタン押下",
msg: "更新ボタンが押されました。",
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.INFO
});
}
});