EXTJS中如何给选项卡内创建grid万分感激! 我现在选项卡内有两项a,b现在想给a和b中各创建一个不同的grid一直不成功,那位可以给贴个代码或说下解决办法,万分感激! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用 Extjs Designer 直接拖进去即可。 { xtype: 'tabpanel', activeTab: 1, width: 400, height: 250, items: [ { xtype: 'panel', title: 'Tab 1', items: [ { xtype: 'grid', title: 'My Grid', height: 217, columns: [ { xtype: 'gridcolumn', dataIndex: 'string', header: 'Column', sortable: true, width: 100 }, { xtype: 'numbercolumn', dataIndex: 'number', header: 'Column', sortable: true, width: 100, align: 'right' }, { xtype: 'datecolumn', dataIndex: 'date', header: 'Column', sortable: true, width: 100 }, { xtype: 'booleancolumn', dataIndex: 'bool', header: 'Column', sortable: true, width: 100 } ] } ] }, { xtype: 'panel', title: 'Tab 2', items: [ { xtype: 'grid', title: 'My Grid', height: 215, columns: [ { xtype: 'gridcolumn', dataIndex: 'string', header: 'Column', sortable: true, width: 100 }, { xtype: 'numbercolumn', dataIndex: 'number', header: 'Column', sortable: true, width: 100, align: 'right' }, { xtype: 'datecolumn', dataIndex: 'date', header: 'Column', sortable: true, width: 100 }, { xtype: 'booleancolumn', dataIndex: 'bool', header: 'Column', sortable: true, width: 100 } ] } ] } ]}这里store你自己写,监听gridpanel的active事件,然后加载store ext4Ext.onReady(function() { Ext.create('Ext.data.Store', { storeId: 'simpsonsStore', fields: ['name', 'email', 'phone'], data: { 'items': [{ "name": "Lisa", "email": "[email protected]", "phone": "555-111-1224" }, { "name": "Bart", "email": "[email protected]", "phone": "555--222-1234" }, { "name": "Homer", "email": "[email protected]", "phone": "555-222-1244" }, { "name": "Marge", "email": "[email protected]", "phone": "555-222-1254" }] }, proxy: { type: 'memory', reader: { type: 'json', root: 'items' } } }); var grid1 = Ext.create('Ext.grid.Panel', { title: 'Simpsons', store: Ext.data.StoreManager.lookup('simpsonsStore'), columns: [{ header: 'Name', dataIndex: 'name' }, { header: 'Email', dataIndex: 'email', flex: 1 }, { header: 'Phone', dataIndex: 'phone' }], height: 200, width: 400 }); var grid2 = Ext.create('Ext.grid.Panel', { title: 'Simpsons', store: Ext.data.StoreManager.lookup('simpsonsStore'), columns: [{ header: 'Name', dataIndex: 'name' }, { header: 'Email', dataIndex: 'email', flex: 1 }, { header: 'Phone', dataIndex: 'phone' }], height: 200, width: 400 }); var tabs = Ext.createWidget('tabpanel', { renderTo: 'tabs1', width: 450, activeTab: 0, defaults: { bodyPadding: 10 }, items: [{ items: grid1, title: 'A', closable: true }, { items: grid2, title: 'B', }] });});<body> <div id="tabs1"> <div id="a"> </div> <div id="b"> </div> </div></body> XPATH问题 div怎么浮动出现在文本框的正下方 js的问题 window.showModalDialog()使用的类似方法 弹出的对话框不带有网页的边框且不被浏览器所阻止那位高手在帮帮 菜鸟在学习,有问题,在线等待。解决后立刻给分。 Netscape 的烦恼!!! 好像有一个activeX,可以关闭不是window.open打开的IE窗口?有谁知道,我以前在哪儿见过的,忘了!! 大神来看看 echarts动态改变线条样式,linestyle不起作用 请教一个数组的问题 关于web打印的页面缩放问题
{
xtype: 'tabpanel',
activeTab: 1,
width: 400,
height: 250,
items: [
{
xtype: 'panel',
title: 'Tab 1',
items: [
{
xtype: 'grid',
title: 'My Grid',
height: 217,
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'string',
header: 'Column',
sortable: true,
width: 100
},
{
xtype: 'numbercolumn',
dataIndex: 'number',
header: 'Column',
sortable: true,
width: 100,
align: 'right'
},
{
xtype: 'datecolumn',
dataIndex: 'date',
header: 'Column',
sortable: true,
width: 100
},
{
xtype: 'booleancolumn',
dataIndex: 'bool',
header: 'Column',
sortable: true,
width: 100
}
]
}
]
},
{
xtype: 'panel',
title: 'Tab 2',
items: [
{
xtype: 'grid',
title: 'My Grid',
height: 215,
columns: [
{
xtype: 'gridcolumn',
dataIndex: 'string',
header: 'Column',
sortable: true,
width: 100
},
{
xtype: 'numbercolumn',
dataIndex: 'number',
header: 'Column',
sortable: true,
width: 100,
align: 'right'
},
{
xtype: 'datecolumn',
dataIndex: 'date',
header: 'Column',
sortable: true,
width: 100
},
{
xtype: 'booleancolumn',
dataIndex: 'bool',
header: 'Column',
sortable: true,
width: 100
}
]
}
]
}
]
}这里store你自己写,监听gridpanel的active事件,然后加载store
Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
fields: ['name', 'email', 'phone'],
data: {
'items': [{
"name": "Lisa",
"email": "[email protected]",
"phone": "555-111-1224" },
{
"name": "Bart",
"email": "[email protected]",
"phone": "555--222-1234" },
{
"name": "Homer",
"email": "[email protected]",
"phone": "555-222-1244" },
{
"name": "Marge",
"email": "[email protected]",
"phone": "555-222-1254" }] },
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'items' } } });
var grid1 = Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [{
header: 'Name',
dataIndex: 'name' },
{
header: 'Email',
dataIndex: 'email',
flex: 1 },
{
header: 'Phone',
dataIndex: 'phone' }],
height: 200,
width: 400
}); var grid2 = Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [{
header: 'Name',
dataIndex: 'name' },
{
header: 'Email',
dataIndex: 'email',
flex: 1 },
{
header: 'Phone',
dataIndex: 'phone' }],
height: 200,
width: 400
});
var tabs = Ext.createWidget('tabpanel', {
renderTo: 'tabs1',
width: 450,
activeTab: 0,
defaults: {
bodyPadding: 10 },
items: [{
items: grid1,
title: 'A',
closable: true },
{
items: grid2,
title: 'B',
}] });});<body> <div id="tabs1">
<div id="a">
</div>
<div id="b">
</div>
</div></body>