PDA

View Full Version : Display problem within treecolumn



JAD1951
9 Jul 2013, 6:12 AM
I have a treecolumn inside the Ext.tree.Panel (singleExpand: true). There is 5 nodes. When I expand the 2nd node and than the 1st one I see that the 2nd node is collapsed but his last child is doubled.

slemmon
11 Jul 2013, 12:23 PM
I wasn't able to reproduce the issue using the test case below. Are you seeing the issue in 4.2.1? Is my test case sufficient to demonstrate the issue?



var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [{
text: "first",
children: [{
text: "first child",
leaf: true
}]
}, {
text: "second",
children: [{
text: "second child",
leaf: true
}]
}, {
text: "third",
children: [{
text: "third child",
leaf: true
}]
}, {
text: "fourth",
children: [{
text: "fourth child",
leaf: true
}]
}, {
text: "fifth",
children: [{
text: "fifth child",
leaf: true
}]
}]
}
});


Ext.create('Ext.tree.Panel', {
title: 'Simple Tree',
width: 200,
height: 150,
store: store,
rootVisible: false,
renderTo: Ext.getBody(),
singleExpand: true
});

JAD1951
11 Jul 2013, 2:14 PM
Dear Slemmon,

My structure is more complicated.
I have placed more information at "http://www.sencha.com/forum/showthread.php?267657-Display-problem-within-treecolumn".
I have this problem with "ext-4.2.1.744" and "ext-4.2.1.883".
I have looked "onNodeCollapse" (line 76860), "onRemove" (line 114490), "doRemove" (line 114533) and "removeElement" (line 104406) inside "ext-all-debug.js" of the "ext-4.2.1.883" version.

Best regards

JAD

JAD1951
11 Jul 2013, 2:38 PM
Dear Slemmon,
Try with the following structure:


var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [{
text: "1",
children: [
{
text: "1-1",
leaf: false,
children: [
{
text: "1-1-1",
leaf: true
}
,{
text: "1-1-2",
leaf: true
}
,{
text: "1-1-3",
leaf: true
}
]
}
,{
text: "1-2",
leaf: false,
children: [
{
text: "1-2-1",
leaf: true
}
,{
text: "1-2-2",
leaf: true
}
,{
text: "1-2-3",
leaf: true
}
,{
text: "1-2-4",
leaf: true
}
]
}
]
}, {
text: "2",
children: [
{
text: "2-1",
leaf: false,
children: [
{
text: "2-1-1",
leaf: true
}
,{
text: "2-1-2",
leaf: true
}
,{
text: "2-1-3",
leaf: true
}
]
}
,{
text: "2-2",
leaf: false,
children: [
{
text: "2-2-1",
leaf: true
}
,{
text: "2-2-2",
leaf: true
}
,{
text: "2-2-3",
leaf: true
}
]
}
]
}, {
text: "3",
children: [
{
text: "3-1",
leaf: false,
children: [
{
text: "3-1-1",
leaf: true
}
,{
text: "3-1-2",
leaf: true
}
,{
text: "3-1-3",
leaf: true
}
]
}
,{
text: "3-2",
leaf: false,
children: [
{
text: "3-2-1",
leaf: true
}
,{
text: "3-2-2",
leaf: true,
}
,{
text: "3-2-3",
leaf: true
}
]
}
]
}, {
text: "4",
children: [
{
text: "4-1",
leaf: false,
children: [
{
text: "4-1-1",
leaf: true
}
,{
text: "4-1-2",
leaf: true
}
,{
text: "4-1-3",
leaf: true
}
]
}
,{
text: "4-2",
leaf: false,
children: [
{
text: "4-2-1",
leaf: true
}
,{
text: "4-2-2",
leaf: true,
}
,{
text: "4-2-3",
leaf: true
}
]
}
]
}, {
text: "5",
children: [
{
text: "5-1",
leaf: false,
children: [
{
text: "5-1-1",
leaf: true
}
,{
text: "5-1-2",
leaf: true
}
,{
text: "5-1-3",
leaf: true
}
]
}
,{
text: "5-2",
leaf: false,
children: [
{
text: "5-2-1",
leaf: true
}
,{
text: "5-2-2",
leaf: true,
}
,{
text: "5-2-3",
leaf: true
}
]
}
]
}]
}
});

Best regards

JAD

JAD1951
12 Jul 2013, 12:17 PM
My real application use the XML files and the readers with my own modifications : I have to adapt my appli to the new, extjs 4.x, VMC, declaration of the XML behavior. So, the problem comes, peut-Ítre, from this modification : I will take you inform the results of my researches.

Best regards

JAD

JAD1951
15 Jul 2013, 1:34 PM
Dear Slemmon,

I have modified my project and now you can try to debug my problem.
The tree named "Staff" works corectly : all items are generated with 'id'. The second, "Equipements", is without 'id' generated by my data base : and here is a problem with the collapse/extend.

Best regards

JAD1951

P.S. you have unzip the attached file. The "extjs" folder with ExtJS v4 have to be placed in the same folder with "motile_v4" project

slemmon
18 Jul 2013, 11:42 AM
Not sure I'll have time to debug the app you've zipped. Do you have a test case you could post that just demonstrates the issue you're seeing with the tree? Just the tree + store + associated dataset that shows the issue?

JAD1951
18 Jul 2013, 12:30 PM
Dear Slemmon,

I don't know what I can do more. I think that the problem is created when the ExtJS generates the 'id' for each item. You can see that when debugging under Firebug and Firefox.
For the case with a bug ("Equipments" tab, file "equipments.xml" inside "xml_test" folder) :
before the 3rd step (see http://www.sencha.com/forum/showthread.php?267657-Display-problem-within-treecolumn) you should set a break point at 23138 (removeIndex = me.indexOfKey(itemKey);) : in this case I have me.indexOfKey('jad-20-constraints') = -1 so this element will not be removed.
The same situation for "Staff" tab (file "staff.xml") with the generated "id" works fine.

Best regards

JAD1951
44938