I have a treepanel, and as the user clicks on the plus signs it fetches the next level of the tree from the server. All was working well.
But now I've run into a problem where I'm getting an exception in ext-debug-all.js, in this code:
The bolded line is where the problem is occurring.Code:updateIndexes : function(startIndex, endIndex) { var ns = this.all.elements, records = this.store.getRange(), i; startIndex = startIndex || 0; endIndex = endIndex || ((endIndex === 0) ? 0 : (ns.length - 1)); for (i = startIndex; i <= endIndex; i++) { ns[i].viewIndex = i; ns[i].viewRecordId = records[i].internalId; if (!ns[i].boundView) { ns[i].boundView = this.id; } } },
I see that I'm not the only one to hit a problem here:
http://www.sencha.com/forum/showthre....updateIndexes
http://www.sencha.com/forum/showthread.php?191149
Is there still a bug in this area? I'm using ExtJS 4.1.3.
What I'm seeing in the debugger is that sure enough, the ns array has one more item than the records array, hence the exception.
What I'm noticing is that this happens when I expand a second node that has the same name as another node that's already been expanded. The same name, but not the same id. I'm assuming the same name or text shouldn't matter, correct?
So for example if my tree looks like:
product1
product2
----groups
----installation-images
----nodes
----revision-images
----template-images
product3
----groups
----installation-images
----nodes
----plugin-images
product4
product5
If I expand 'nodes' under product2, then expand 'nodes' under product3, I hit this exception. I also hit it if I expand those nodes called 'nodes' in the opposite order. When I expand all the items in each array in the debugger, I see there's a duplicate product5 in the ns array. That sure smells like an ExtJS bug (as in, something isn't getting cleaned up).
(As another point of reference, if I create a couple of groups under product2/groups, and then expand each node (Group1, then Group2), I'll hit the same exception.)
I'm honestly not sure if I'm doing something wrong, or if there's another bug in ExtJS.
But if someone could point me in a direction so I could debug this, I'd be really grateful. For example, what's this ns array, and who populates it? If I could figure that out, then I could probably figure out where the duplicate entry is coming from.
Thanks,
Brian