2011-05-09 157 views
0
Ext.onReady(function(){ 
    var tree = new Ext.tree.TreePanel({ 
     renderTo:'tree-div', 
     title: 'My Task List', 
     height: 300, 
     width: 400, 
     useArrows:true, 
     autoScroll:true, 
     animate:true, 
     enableDD:true, 
     containerScroll: true, 
     rootVisible: false, 
     frame: true, 
     root: { 
      nodeType: 'async' 
     }, 

在上面的代码中,useArrows:true的含义是什么?是用箭头显示树结构的属性(内置)?'useArrows:true'的意义是什么?

回答

4

据我所见,useArrows: true会导致使用Vista风格的箭头代替文件夹嵌套中的+/-符号和行来渲染树。

从TreePanel.js

// private 
onRender : function(ct, position){ 
    Ext.tree.TreePanel.superclass.onRender.call(this, ct, position); 
    this.el.addClass('x-tree'); 
    this.innerCt = this.body.createChild({tag:'ul', 
      cls:'x-tree-root-ct ' + 
      (this.useArrows ? 'x-tree-arrows' : this.lines ? 'x-tree-lines' : 'x-tree-no-lines')}); 
}, 

从ExtJS的API

useArrows布尔
真树使用Vista风格箭头(默认为false)