2011-05-09 39 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)