我正在研究一个树组合框(组合框内的树面板),我有一个树存储来加载树组合框。
我想提供全选功能,所以想添加一个新的根,它将成为现有树存储数据的父级。
树店:
var store = new Ext.data.TreeStore({
root: {
expanded: true,
children: [
{ text: "Numbers", expanded: false, children: [
{ text: '1', leaf: true },
{ text: '2', leaf: true },
{ text: '3', leaf: true },
{ text: '4', leaf: true },
{ text: '5', leaf: true },
] },
{ text: "Letters", expanded: true, children: [
{ text: 'A', leaf: true },
{ text: 'B', leaf: true },
{ text: 'C', leaf: true },
{ text: 'D', leaf: true },
{ text: 'E', leaf: true },
] },
{ text: "Colors", expanded: false, children: [
{ text: 'Red', leaf: true },
{ text: 'Green', leaf: true },
{ text: 'Blue', leaf: true }
] }
]
}
});