It called when {@link Listbox} or {@link Grid} has to sortthe content.
After sorting, this model shall notify the instances of {@link org.zkoss.zul.event.ListDataListener} (registered thru {@link ListModel#addListDataListener}) to update the content. Typically you have to notify with
new ListDataEvent(this, ListDataEvent.CONTENTS_CHANGED, -1, -1)
to denote all data are changed (and reloading is required).
The comparator assigned to, say, {@link Listheader#setSortAscending}is passed to method as the cmpr argument. Thus, developers could use it as a tag to know which column or what kind of order to sort.
@param cmpr the comparator assigned to {@link Listheader#setSortAscending}and other relative methods. If developers didn't assign any one, the default comparator is used.
@param ascending whether to sort in the ascending order (or inthe descending order)