1234567891011121314151617181920212223242526272829303132333435363738 |
- /**
- * Created by vian on 2017/4/10.
- */
- var billsLibTree = {
- setting: {
- id: 'ID',
- pid: 'ParentID',
- nid: 'NextSiblingID',
- rootId: -1
- },
- virtualRoot: [{
- ID: 1,
- ParentID: -1,
- NextSiblingID: -1,
- code: '开始编辑',
- }],
- createBillsTree: function(){
- var billsTree = function(){
- this.datas = null;
- this.tree = null;
- };
- billsTree.prototype.loadDatas = function(datas){
- if(datas){
- this.datas = datas;
- this.tree = idTree.createInit(billsLibTree.setting);
- this.tree.loadDatas(this.datas);
- }
- else {
- this.datas = [];
- this.tree = idTree.createInit(billsLibTree.setting);
- this.tree.loadDatas(this.datas);
- }
- };
- return new billsTree();
- }
- }
|