dynamic tree
How can I create an dynamic tree?Must I scrape together an treeView array in the backround ? Such as complicated corporations organization and staff member.I try this,But at last, I lose my senses at the big array...
{0:[]1:[]2:[5,6,25,26]3:[]4:[16,17,18,29,43,44]5:[7,8,9,10,12,15]6:[]7:[27,28]8:[39,40,41,42]9:[]10:[3,4,13,14,19,20,21,22,23]11:[]12:[]13:[]14:[]15:[]16:[]17:[]18:[]19:[]20:[]21:[33,34]22:[11,24]23:[]24:[30,31,32]25:[]26:[]27:[]28:[]29:[35,36,37,38]30:[]31:[]32:[]33:[]34:[]35:[]36:[]37:[]38:[]39:[]40:[]41:[]42:[]43:[]...}
hope your help
jinchao
August 23,
I known how to create the dynamic tree.But I donot how to organize an complicated treeView,can you give me some advice.
jinchao
August 23,
Well, not sure if there is a better/cleaner way, ... but I am using
line-breaks (with tabular margins in treeText) and also commented to get a more clear diagram.
something like:
var treeText = ["",
"Sales", //1
"Direct Sales", //2
"Sales Manager North", // 3
"Senior Seller North", //4
"Junior Seller North", //5
"Sales Manager South", //6
"Senior Sellerr South", //7
"Junior Seller South", //8
"TeleSales", //9
"Tele-Seller", //10
"Marketing", //11
"Analist", //12
"RRHH", //13
"Selection", //14
"Selector RRHH", //15
"Development", //16
"Technic", //17
"Purchases", //18
"Purchaser" //19
];
var treeView = {
0:[1,13,18], // "Sales", "RRHH", "Purchases"
1:[2, 9, 11], // "Direct Sales", "TeleSales", "Marketing",
2:[3, 6], // "Sales Manager North",
3:[4], // "Senior Seller North",
4:[5], // "Junior Seller North",
6:[7],
7:[8],
9:[10],
11:[12],
13:[14,16],
14:[15],
16:[17],
18:[19] // "Purchaser"
};
C++
August 24,
var treeText = ["",
"Sales",
"Direct Sales",
"Sales Manager North",
"Senior Seller North",
"Junior Seller North",
"Sales Manager South",
"Senior Sellerr South",
"Junior Seller South",
"TeleSales",
"Tele-Seller",
"Marketing",
"Analist",
"RRHH",
"Selection",
"Selector RRHH",
"Development",
"Technic",
"Purchases",
"Purchaser"
];
var treeView = {
0:[1,13,18],
1:[2, 9, 11],
2:[3, 6],
3:[4],
4:[5],
6:[7],
7:[8],
9:[10],
11:[12],
13:[14,16],
14:[15],
16:[17],
18:[19]
};
C++
August 24,