PDA

View Full Version : TreePanel IE script error



M1ke
4 Jan 2010, 1:10 AM
Hi,
This problem probably was posted about before, but I couldn't find that much on it so I'm starting a new thread.
I'm using a TreePanel since I updated from GXT 1.2.4 to GXT 2.1.0. The TreePanel contains about 150 nodes and each node has an average leaf count of 50. This tree loads OK in IE7 using GXT 1.2.4's TreeBuilder. With 2.0.1 this results in IE7 generating scripting errors when loading the same data in a TreePanel using TreeStore. I've tried saveral ways to populate the TreePanel, like the Fast Tree, to no avail.
Both Chrome and Firefox do load the tree very fast...

My code looks like the following:



treeStore = new TreeStore<ModelData>();
treePanel = new TreePanel<ModelData>(treeStore);
treePanel.setDisplayProperty("name");
treePanel.setTrackMouseOver(false);
treePanel.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
...
for (Parent parent: parentList) {
treeStore.add(parent, false);
treePanel.setLeaf(parent, true);
treeStore.insert(parent, parent.getChildren(), 0, false);
for (ModelData child:parent.getChildren()) {
treePanel.setLeaf(child, false);
}
}


Parent extends BaseTreeModel, as do Parents children.

It seems to be a problem that only occurs when using IE, but that's still a showstopper for me because most users use it. I cannot update my production environment until this is fixed. I know the script prompts can be disabled using IE's settings, but I'd rather not do that.
Any help would be appreciated.

-M

PS. And a happy new year! :)

M1ke
13 Jan 2010, 2:55 AM
Bump

Arno.Nyhm
15 Jan 2010, 8:16 AM
7500 items ... it looks there are many items...

maybe you change it to load the child values asynchronus on demand if they are needed?

M1ke
10 Mar 2010, 4:56 AM
I have changed the tree to asynchronously load the leafs on demand (when expanding a parent). This has gotten rid of the IE script error, using GWT 2.0.3 and GXT 2.1.1. Unfortunately IE8 (8.0.6001.18702) now only paints the items in the tree as far as they are initially visible. Scrolling down results in the other nodes not being shown. Strange thing is that this does not occur in every case with this version of IE. Again, Chrome and Firefox have no problems like this at all...
Maybe somebody has any ideas about this?

sven
11 Mar 2010, 4:27 AM
You should try to post afully working testcase that implements EntryPoint. Without this it is almost impossible to help you.

M1ke
16 Mar 2010, 6:34 AM
Unfortunately it will not be easy to duplicate the problem using a test case. With the same build of IE, different users experience different things with my app. On my workstation it works fine in IE. On the workstation of a colleague of mine, using the same build of IE also mentioned in the previous post, when the scrollbar thumb is slided down the next items in the tree aren't shown. When the scroll wheel on the mouse is used, the tree items are painted on top of eachother, creating a visual mess. It seems something goes wrong when repainting in IE under certain circumstances. It's like the tree isn't repainted, but updated when you scroll. Upon a window resize, the tree contents are displayed correctly.
So even when I produce a fully working test case, it is not guaranteed you will experience the same issues as we do. If I find the time, I'll try to whip something up though.
I have attached a picture of a part of the tree where the overlapping paint occurs. Hope that helps.
--Mike