一个例子求助!
extjs吧
全部回复
仅看楼主
level 1
Ext.define('MyApp.store.MyJsonStore', {
extend: 'Ext.data.Store',
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
storeId: 'MyJsonStore',
proxy: {
type: 'ajax',
reader: {
type: 'json'
}
}
}, cfg)]);
}
});
Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [
{
xtype: 'panel',
height: 30,
title: '南部',
region: 'south'
},
{
xtype: 'panel',
width: 157,
layout: {
type: 'border'
},
title: '功能列表',
region: 'west',
items: [
{
xtype: 'panel',
height: 150,
tpl: Ext.create('Ext.XTemplate',
'未读消息',
'以读消息'
),
title: '我的信箱',
region: 'north'
},
{
xtype: 'panel',
title: '最近编辑的病人',
region: 'center'
}
]
},
{
xtype: 'panel',
layout: {
type: 'border'
},
title: 'My Panel',
region: 'center',
items: [
{
xtype: 'ta
bp
anel',
activeTab: 0,
region: 'center',
items: [
{
xtype: 'panel',
height: 388,
title: 'Tab 1',
dockedItems: [
{
xtype: 'toolbar',
dock: 'top',
items: [
{
xtype: 'button',
text: '住院病案'
},

2012年03月14日 04点03分 1
level 1
{
xtype: 'button',
text: '责任医师配置'
}
]
}
]
},
{
xtype: 'panel',
title: 'Tab 2'
},
{
xtype: 'panel',
title: 'Tab 3'
}
]
},
{
xtype: 'panel',
height: 150,
title: 'My Panel',
region: 'south'
/*注释的部分
,
items: [
{
xtype: 'gridpanel',
title: 'My Grid Panel',
store: 'MyJsonStore',
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'string',
text: 'String'
},
{
xtype: 'numbercolumn',
dataIndex: 'number',
text: 'Number'
},
{
xtype: 'datecolumn',
dataIndex: 'date',
text: 'Date'
},
{
xtype: 'booleancolumn',
dataIndex: 'bool',
text: 'Boolean'
}
],
viewConfig: {
}
}
]
注释的部分*/
}
]
}
]
});
图片不是以上js写的,是用另一种js写的是先写定义,然后创建在调用show方法。
如果我要用以上js写,注释去掉,报错,store没有定义。如果注释去掉,不报错但是图片中注释的表格就会没有。如果我就偏要用以上js来写,应该在注释的代码里怎么改才可以。
2012年03月14日 04点03分 2
level 1
更在:
如果注释加上,不报错但是图片中注释的表格就会没有。如果我就偏要用以上js来写,应该在注释的代码里怎么改才可以。
2012年03月14日 04点03分 3
level 2
兄弟,太长了,看不下去啊,你把其中对应部分的代码贴出来就好了
2012年03月15日 14点03分 4
1