PDA

View Full Version : TreeStore sorting behavior



fsleeman
30 Jan 2014, 8:43 AM
I programatically (i.e. not loading from json) created a TreeStore and viewed it in a TreePanel. Everything seems to be fine except for sorting. For example, if I have a structure like:


Root
level 1.a
level 2.a
level 2.b
level 1.b
level 1.c



And I try to sort by one of the fields I get something like this:


Root
level 1.a
level 2.a
level 2.b
level 1.b
level 1.c


Notice the level 1.b now is a child of level 1.a. I get other strange behavior like that and in some cases error message like this:

TypeError: record is undefined




isNotPhantom = record.phantom !== true;







I tried using the 'folderSort: true,' config in the store and panel but it doesn't seem to do anything. Does anybody know what this is happening and how to get around this?

fsleeman
30 Jan 2014, 9:41 AM
I seem to get the same result even if I reading directy from a json file using ajax.

slemmon
3 Feb 2014, 1:51 PM
Do you have a test case you could post so that the community can review your code with you to see what might be at issue?

You can post a test case at https://fiddle.sencha.com using your forum login and password if that helps.