PDA

View Full Version : Having Problem with Ext.tree.TreeSorter after update to Ext 3.3



scottlusk.cis
15 Nov 2010, 10:55 AM
Can someone tell me if something has changed with the "sortType" for an Ext.tree.TreeSorter with ExtJs 3.3.0? Below is my code I had that worked fine prior to updating to v3.3.0 but now it doesn't find .attributes.priority, doesn't even find .attributes. When I inspect "node" now it is just a string representing the text of the node and thats it. Prior to update "node" was an object that had properties that could be accessed. Am I missing something, has something changed? Thanks for your input.



// Sorter used to sort the nodes in the tree
this._sorter = new Ext.tree.TreeSorter(this, {
dir: "asc", // Direction will be ascending order
sortType: function(node) {
// Sorting will be based on the priority
return parseInt(node.attributes.priority, 10);
}
});


My component extends Ext.tree.TreePanel and the code above is called in the afterRender of the tree component.

scottlusk.cis
16 Nov 2010, 7:20 AM
Found reference to this at the link below

http://www.sencha.com/forum/showthread.php?112277-OPEN-1322-Ext.tree.TreeSorter-bug-property-used-even-if-sortType-is-specified&highlight=sortType+3.3+property

scottlusk.cis
16 Nov 2010, 7:22 AM
Was able to resolve the problem by adding the property and folderSort config options to my treeSorter. However, my property was an integer and apparently treeSorter expects a string so I had to go through my code and convert my value to a string. This was a pain. Does anyone know if it is going to be changed back to passing the node or will the sorter accepts an integer value? Thanks for any input.