| org.zkoss.zul.ListModelExt
All known Subclasses: org.zkoss.zul.SimpleListModel, org.zkoss.zul.ListModelSet, org.zkoss.zul.ListModelList, org.zkoss.zul.ListModelMap, org.zkoss.zul.ListModelArray,
ListModelExt | public interface ListModelExt (Code) | | An extra interface that can be implemented with
ListModel to control the sorting of the listbox.
author: tomyeh |
Method Summary | |
public void | sort(Comparator cmpr, boolean ascending) It called when
Listbox or
Grid has to sort
the content.
After sorting, this model shall notify the instances of
org.zkoss.zul.event.ListDataListener (registered thru
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,
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.
Parameters: cmpr - the comparator assigned to Listheader.setSortAscendingand other relative methods. |
sort | public void sort(Comparator cmpr, boolean ascending)(Code) | | It called when
Listbox or
Grid has to sort
the content.
After sorting, this model shall notify the instances of
org.zkoss.zul.event.ListDataListener (registered thru
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,
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.
Parameters: cmpr - the comparator assigned to Listheader.setSortAscendingand other relative methods. If developers didn't assign any one,the default comparator is used. Parameters: ascending - whether to sort in the ascending order (or inthe descending order) |
|
|