Skip to content

Commit d04d748

Browse files
committed
gridpanel
1 parent 0e2d909 commit d04d748

File tree

5 files changed

+41
-6
lines changed

5 files changed

+41
-6
lines changed

_me/form1.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
xtype: "panel"
33
,title: "Form 1"
4-
,id: "grid-dynamic-blotter"
4+
,id: "form1"
55
,columnLayout:1
66
,items:[{
77
xtype: "form"

_me/grid1-data.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{'items':[
2+
{ 'name': 'Lisa', "email":"[email protected]", "phone":"555-111-1224" },
3+
{ 'name': 'Bart', "email":"[email protected]", "phone":"555-222-1234" },
4+
{ 'name': 'Homer', "email":"[email protected]", "phone":"555-222-1244" },
5+
{ 'name': 'Marge', "email":"[email protected]", "phone":"555-222-1254" }
6+
]}

_me/grid1.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
xtype: "gridpanel"
3+
,title: "Grid 1"
4+
,id: "grid1"
5+
,loadMask : true
6+
,columns: [
7+
{ text: 'Name', dataIndex: 'name' },
8+
{ text: 'Email', dataIndex: 'email', flex: 1 },
9+
{ text: 'Phone', dataIndex: 'phone' }
10+
]
11+
,store: {
12+
storeId:'simpsonsStore',
13+
fields:['name', 'email', 'phone'],
14+
proxy: {
15+
type: 'ajax'
16+
,url: 'grid1-data.json'
17+
,reader: {
18+
type: 'json',
19+
root: 'items'
20+
}
21+
,autoLoad: true
22+
}
23+
}
24+
,listeners: {
25+
render: function(){
26+
this.store.load();
27+
}
28+
,itemdblclick: function( grid, record, item, index, e, eOpts ){
29+
console.log("You clicked row "+index);
30+
}
31+
}
32+
}

_me/layout.js

-3
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,6 @@ Ext.onReady(function(){
253253
renderTo: Ext.getBody()
254254
});
255255

256-
// This callback will execute in the scope of the
257-
// button instance. Clicking the button alerts
258-
// "Hi, Fred. You clicked the "Say Hi" button."
259256
btn.on('click', Ext.bind(sayHi, btn, ['Fred']));
260257

261258
Ext.create('Ext.Viewport', {

_me/tree-data.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ children: [{
1212
id:'form2',
1313
leaf:true
1414
},{
15-
text:'Anchor',
16-
id:'anchor',
15+
text:'Grid 1',
16+
id:'grid1',
1717
leaf:true
1818
},{
1919
text:'Border',

0 commit comments

Comments
 (0)