みなさん、私は ExtJS 3.2 、 PHP5.3 、および Oracle 10g XE を持っています。
MyExtJs.php から返された JSON:
[{"FIRST_NAME":"エレン","LAST_NAME":"アベル"},{"FIRST_NAME":"サンダー","LAST_NAME":"アンデ"}, {"FIRST_NAME":"モジェ","LAST_NAME": "アトキンソン"},{"FIRST_NAME":"デビッド","LAST_NAME":"オースティン"},{"FIRST_NAME":"ヘルマン","LAST_NAME":"ベア"},{"FIRST_NAME":"シェリー", "LAST_NAME":"バイダ"},{"FIRST_NAME":"アミット","LAST_NAME":"バンダ"},{"FIRST_NAME":"エリザベス","LAST_NAME":"ベイツ"},{"FIRST_NAME": "サラ","LAST_NAME":"ベル"},{"FIRST_NAME":"デビッド","LAST_NAME":"バーンスタイン"}]
データ ストア:
var store = new Ext.data.JsonStore( {
autoLoad: true,
url: 'MyExtJs.php',
fields: [
{name: 'firstname'},
{name: 'lastname'}
]
});
グリッド:
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{
id : 'fname',
header : 'First Name',
width : 160,
sortable : true,
dataIndex: 'firstname'
},
{
id : 'lname',
header : 'Last Name' ,
width : 75,
sortable : true,
dataIndex: 'lastname'
}
],
stripeRows: true,
height: 300,
width: 500,
title: 'Report',
autoExpandColumn: 'lname',
stateful: true,
stateId: 'grid'
});
グリッドのヘッダーと境界線のみを表示しますが、内部にはデータを表示しません。
敬具、ダン