It checks {@link #getSortDirection} to see whether sorting is required,and update {@link #setSortDirection} after sorted. For example, if{@link #getSortDirection} returns "ascending" and the ascending argumentis false, nothing happens. To enforce the sorting, you can invoke {@link #setSortDirection} with "natural" before invoking this method.Alternatively, you can invoke {@link #sort(boolean,boolean)} instead.
It sorts the listitem by use of {@link Components#sort} data (i.e.,{@link Grid#getModel} is null).
On the other hand, it invokes {@link org.zkoss.zul.ListModelExt#sort} tosort the list item, if live data (i.e., {@link Listbox#getModel} is notnull). In other words, if you use the live data, you have to implement {@link org.zkoss.zul.ListModelExt} to sort the live data explicitly. @param ascending whether to use {@link #getSortAscending}. If the corresponding comparator is not set, it returns false and does nothing. @return whether the list items are sorted. @exception UiException if {@link Listbox#getModel} is not null but{@link org.zkoss.zul.ListModelExt} is not implemented.
|
|