PDA

View Full Version : [FIXED] [4.2.1] TreeStore: added sub-children nodes are not phantoms



realgaa
10 Oct 2013, 12:42 AM
If we call NodeInterface appendChild method providing object having children property we don't get added child records as "phantoms".

Please take a look at test case here:
http://fiestadev.bryntum.com/#249-treestore-added-sub-children-nodes-are-not-phantom

And here is the same test case for local environment usage:

var store = new Ext.data.TreeStore({ root : {} });

store.getRootNode().appendChild({
expanded : true,
children : [{
expanded : true,
children : [{
leaf : true
}]
}]
})

// expected to have 3 phantom nodes
t.is(store.getNewRecords().length, 3, '3 phantom nodes found')

Gary Schlosberg
10 Oct 2013, 6:33 AM
Thanks for the report. Is it possible to create a test case that runs independently of Fiesta, ideally in a Sencha Fiddle (http://fiddle.sencha.com)?

realgaa
10 Oct 2013, 8:14 PM
In the above code only one line is Siesta specific. Here it is:


t.is(store.getNewRecords().length, 3, '3 phantom nodes found')

And you definitely can change it as you like to something like this:

alert('Found '+store.getNewRecords().length+' phantom nodes of 3 expected')
or like this:

if (store.getNewRecords().length < 3) throw 'Found '+store.getNewRecords().length+' phantom nodes of 3 expected';
:)

Gary Schlosberg
12 Oct 2013, 5:31 AM
Good to know, thanks! I'll remember that for future Fiesta test cases.

Thanks for the report! I have opened a bug in our bug tracker.