Javascript 扩展行中的Ext JS组件
这里有一个简单的问题:我的ExtJS应用程序中有一个扩展行的工作网格Boom. 目前,我在扩展行中有Javascript 扩展行中的Ext JS组件,javascript,extjs,grid,row,Javascript,Extjs,Grid,Row,这里有一个简单的问题:我的ExtJS应用程序中有一个扩展行的工作网格Boom. 目前,我在扩展行中有html元素(它只是一个大的div),但这似乎是扩展行能够显示的全部内容 在我展开的行中是否仍有渲染Ext组件的方法 干杯,伙计们,投票等待 只需将组件渲染到行展开器元素中即可 var grid = Ext.create('Ext.grid.Panel', { title: 'Simpsons', plugins: { ptype: 'rowexpander',
html
元素(它只是一个大的div
),但这似乎是扩展行能够显示的全部内容
在我展开的行中是否仍有渲染Ext组件的方法
干杯,伙计们,投票等待 只需将组件渲染到行展开器元素中即可
var grid = Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
plugins: {
ptype: 'rowexpander',
rowBodyTpl : [
'<div class="row-expander-ct"></div>'
]
},
store: {
fields:['name', 'email', 'phone'],
data: [
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" }
]
},
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 300,
width: 400,
renderTo: Ext.getBody()
});
grid.store.on({
// Delay the execution of the listener because the grid view will also
// react to this event, and we want the rows to be rendered before we
// modify them...
delay: 1,
load: function() {
Ext.each(grid.el.query('.row-expander-ct'), function(ct) {
Ext.widget('textfield', {
renderTo: ct
,fieldLabel: "Label"
,width: '100%'
});
});
}
});
grid.store.load();
var grid=Ext.create('Ext.grid.Panel'{
标题:《辛普森一家》,
插件:{
p类型:“行扩展器”,
rowBodyTpl:[
''
]
},
商店:{
字段:[“姓名”、“电子邮件”、“电话”],
数据:[
{“姓名”:“丽莎”,“电子邮件”:lisa@simpsons.com,“电话”:“555-111-1224”},
{'name':'Bart',“email”:bart@simpsons.com,“电话”:“555-222-1234”},
{'name':'Homer',“email”:home@simpsons.com,“电话”:“555-222-1244”},
{'name':'Marge',“email”:marge@simpsons.com,“电话”:“555-222-1254”}
]
},
栏目:[
{text:'Name',dataIndex:'Name'},
{text:'Email',dataIndex:'Email',flex:1},
{text:'Phone',dataIndex:'Phone'}
],
身高:300,
宽度:400,
renderTo:Ext.getBody()
});
grid.store.on({
//延迟侦听器的执行,因为网格视图也将
//对该事件做出反应,我们希望在开始之前呈现行
//修改它们。。。
延误:1,
加载:函数(){
Ext.each(grid.el.query('.row expander-ct')、函数(ct){
Ext.widget('textfield'{
渲染器:ct
,fieldLabel:“标签”
,宽度:“100%”
});
});
}
});
grid.store.load();
只需将组件渲染到行展开器元素中即可
var grid = Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
plugins: {
ptype: 'rowexpander',
rowBodyTpl : [
'<div class="row-expander-ct"></div>'
]
},
store: {
fields:['name', 'email', 'phone'],
data: [
{ 'name': 'Lisa', "email":"lisa@simpsons.com", "phone":"555-111-1224" },
{ 'name': 'Bart', "email":"bart@simpsons.com", "phone":"555-222-1234" },
{ 'name': 'Homer', "email":"home@simpsons.com", "phone":"555-222-1244" },
{ 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254" }
]
},
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 300,
width: 400,
renderTo: Ext.getBody()
});
grid.store.on({
// Delay the execution of the listener because the grid view will also
// react to this event, and we want the rows to be rendered before we
// modify them...
delay: 1,
load: function() {
Ext.each(grid.el.query('.row-expander-ct'), function(ct) {
Ext.widget('textfield', {
renderTo: ct
,fieldLabel: "Label"
,width: '100%'
});
});
}
});
grid.store.load();
var grid=Ext.create('Ext.grid.Panel'{
标题:《辛普森一家》,
插件:{
p类型:“行扩展器”,
rowBodyTpl:[
''
]
},
商店:{
字段:[“姓名”、“电子邮件”、“电话”],
数据:[
{“姓名”:“丽莎”,“电子邮件”:lisa@simpsons.com,“电话”:“555-111-1224”},
{'name':'Bart',“email”:bart@simpsons.com,“电话”:“555-222-1234”},
{'name':'Homer',“email”:home@simpsons.com,“电话”:“555-222-1244”},
{'name':'Marge',“email”:marge@simpsons.com,“电话”:“555-222-1254”}
]
},
栏目:[
{text:'Name',dataIndex:'Name'},
{text:'Email',dataIndex:'Email',flex:1},
{text:'Phone',dataIndex:'Phone'}
],
身高:300,
宽度:400,
renderTo:Ext.getBody()
});
grid.store.on({
//延迟侦听器的执行,因为网格视图也将
//对该事件做出反应,我们希望在开始之前呈现行
//修改它们。。。
延误:1,
加载:函数(){
Ext.each(grid.el.query('.row expander-ct')、函数(ct){
Ext.widget('textfield'{
渲染器:ct
,fieldLabel:“标签”
,宽度:“100%”
});
});
}
});
grid.store.load();