ui is null or not an object for treepanel

July 4th, 2009
Hi,
I have a tree panel in viewport.
Now, my flow is like I have a tree in following format:

-A
-B
-C
-D
+E
Now here C and D are leafs and I have customised it such that on('beforeclick') event of a leaf(suppose 'C') it will convert the tree in below format:

-A
-B
-C

For this I am using code as:
this.on('beforeclick', function(node){
if(node.isLeaf()){
deletNodes(node1,node2);
.
.
}
});

deletNodes() is a function I am defining to delete nodes other than the nodes in path of selected node from tree .
Now I have a condition in which I am deleting the complete rootnode.
i.e. My treePanel becomes empty.

And again according to query tree is being populated.

Now the same behaviour of deleting rest other nodes from tree except path nodes is done and this time when I do a mouse over on the nodes I am getting an error "ui is null or not an object " in IE and ,
in mozilla getting error:

"A has no properties"
On drilling down the error its showing me :

TreeEventModel(Object browserEvent=Event resize button=-1 type=resize, undefined )ext-all.js (line 100)
TreeEventModel(Object browserEvent=Event resize button=-1 type=resize, div.x-tree-node-el)
EventManager(Object browserEvent=Event resize button=-1 type=resize)ext-all.js (line 13)
getViewWidth(mouseout clientX=0, clientY=0)

I guess the problem is in deleteNodes() which is as under:

deleteNodes: function(delnode,my){
if(delnode){
var toRemove = ;
Ext.each(delnode.childNodes, function(item)
{
if (item != my)
toRemove.push(item);
});

Ext.each(toRemove, function(item1)
{
delnode.removeChild(item1);
});
}

}


Its giving me proper tree after deletion but the error is there on mouse over.
I tried using 'mouseover' event in treePanel but its not recognising the event handler.
The strange thing is its giving me error only if I form the tree(path specific nodes tree) second time and further, for the first time there is no mouseover error.


Please suggest some solution as I have tried every possible way to identify where and why the error is coming....

Thanks in advance......




#If you have any other info about this subject , Please add it free.#
Your name:
E-mail:
Telphone:

Your comments:


If you have any other info about ui is null or not an object for treepanel , Please add it free.

Navigation

Calendar

Blog

Categories

Archives
Search

Links

Feeds and Credits