[英]How to add tree panel to a grid panel column in extjs
I have grid panel. 我有网格面板。 I want to add a tree panel to a column in that grid panel. 我想将树面板添加到该网格面板中的列。
Grid Panel 网格面板
Ext.create('Ext.data.Store', {
storeId: 'simpsonsStore',
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: 'homer@simpsons.com', phone: '555-222-1244' },
{ name: 'Marge', email: 'marge@simpsons.com', phone: '555-222-1254' }
]
});
Ext.create('Ext.grid.Panel', {
title: 'Simpsons',
store: Ext.data.StoreManager.lookup('simpsonsStore'),
columns: [
{ text: 'Name', dataIndex: 'name' },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
],
height: 200,
width: 400,
renderTo: Ext.getBody()
});
Tree Store 树店
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [
{ text: 'detention', leaf: true },
{ text: 'homework', expanded: true, children: [
{ text: 'book report', leaf: true },
{ text: 'algebra', leaf: true}
] },
{ text: 'buy lottery tickets', leaf: true }
]
}
});
For example, If I want to this tree store to come under Name: Lisa
ie, tree expands when we click on Lisa. 例如,如果我想将这个树存储放在Name: Lisa
即当我们点击Lisa时树会扩展。 How can we do it. 我们怎么做呢
Thank you. 谢谢。
What you are searching for is treegrid
. 你要搜索的是treegrid
。
For modern toolkit, check modern treegrid . 对于现代工具包,请检查现代treegrid 。
For classic toolkit, check classic treepanel with multiple columns. 对于经典工具包,请检查具有多列的经典树形图 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.