Processing...
Description & Source Code

Sorting grid data is done by assigning a sorter for the column component.
To start sorting, a user could either click on the column header, or choose the sorting options in the drop down menu (the menupopup component) located at the right edge of a column header.
A menupopup component may be enabled by setting menupopup="auto" for the columns component. if the attribute menupopup is set to "auto" in the columns tag. Users may also show and hide columns from the drop down menu enabled by this setting.

sorting.zul
<grid>
	<columns menupopup="auto">
		<column label="Author" sort="auto" />
		<column label="Title" sort="auto" />
		<column label="Publisher" sort="auto" />
		<column label="Hardcover" />
	</columns>
	<rows>
		<row>
			<label value="Philip Hensher" />
			<label value="The Northern Clemency" />
			<label value="Knopf (October 30, 2008)" />
			<label value="608 pages" />
		</row>
		<row>
			<label value="Philip Hensher" />
			<label value="The Fit" />
			<label value="HarperPerennial (April 4, 2005)" />
			<label value="240 pages" />
		</row>
		<row>
			<label value="Philip Hensher" />
			<label value="Kitchen Venom" />
			<label value="Flamingo (May 19, 2003)" />
			<label value="336 pages" />
		</row>
		<row>
			<label value="Michael Greenberg" />
			<label value="Hurry Down Sunshine" />
			<label value="Other Press (September 9, 2008)" />
			<label value="240 pages" />
		</row>
		<row>
			<label value="Michael Greenberg" />
			<label value="Painless Vocabulary (Painless)" />
			<label value="Barron's Educational Series (September 1, 2001)" />
			<label value="292 pages" />
		</row>
		<row>
			<label value="Rick Perlstein" />
			<label value="Nixonland: The Rise of a President and the Fracturing of America" />
			<label value="Scribner; 1st Scribner Hardcover Ed edition (May 13, 2008)" />
			<label value="896 pages" />
		</row>
		<row>
			<label value="Rick Perlstein" />
			<label value="Nixonland" />
			<label value="Simon &amp; Schuster (May 13, 2008)" />
			<label value="896 pages" />
		</row>
	</rows>
</grid>