开发者

Why TreePanel node & IE bug?

I developed an application with TreePanel . I have a strange behaviour with IE ( tested on IE 7 , 8 ) .

When i click on a node , the screen moves on a center of screen . Like it have a an anchor on my page ... !

My TreePanel is define likt this :

            var monPretree = Ext.create('Ext.tree.Panel',{
            id : 'treepanel',
            title : 'Tree Tasks',
            width : 500,
            animate : false,
            activeItem : 1,
            useArrows : true,
            autoScroll : true,
            singleExpand : fa开发者_如何学Pythonlse,
            store : monPrestore,
            enableDD : true,
            rootVisible : false,

            viewConfig : {
                plugins : {
                    ptype: 'treeviewdragdrop'


                }

            },

I don't know where i can find a solution ... maybe somebody ever meet same problem ?

So, to resolved my problem , i would like if is possible to disable collapse node ? To have treePanel always Expand and forbidden a collapsible mode ?!

Thanks a lot!


There are several ways to disallow a node from expanding. the most straightforward way is making it a leaf thus disallowing it to have children and making expanding impossble. Mostly this is done serverside when retuning the JSON for the tree you just add an attribute leaf:true to each of the nodes that should not be expanded/opened.

[
   {
      "id":"1",
      "name":"Node ONE",
      "leaf":true
   },
   {
      "id":"2",
      "name":"Node TWO",
      "leaf":true
   },
   {
      "id":"3",
      "name":"Node THREE",
      "leaf":true
   }
]

An alternate way of achieving this is by setting the expanded state to true and adding no children to the node, also serverside.

[
   {
      "id":"1",
      "name":"Node ONE",
      "expanded":true,
      "children":[]
   },
   {
      "id":"2",
      "name":"Node TWO",
      "expanded":true,
      "children":[]
   },
   {
      "id":"3",
      "name":"Node THREE",
      "expanded":true,
      "children":[]
   }
]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜