O'Reilly logo

ExtGWT Rich Internet Application Cookbook by Odili Charles Opute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Custom sorting within trees

The default lexicographic schemes employed when sorting strings (the display property) may not suffice in your TreePanel instance. Consider having a tree of nodes representing college students; you may want to sort based on other things besides the node's label — which would of course be the names of the students — such as sorting by their age, year of admission, number of extracurricular activities, and CGPA.

This sort of behavior, which is actually seen in the TreeStore instance, can be controlled by a custom StoreSorter implementation, set on the TreeStore instance with store.setStoreSorter(), and used to determine the ordinal index of a node (relative to its siblings) within a parent node.

How to do it...

Give the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required