-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4088193
By: roxcastaneda
The code snippet below i converted from grid.zul to grid.jsp which is part of the test folder for zkdemo.
My problem is that the grid.zul seems to display and execute sorting but the grid.jsp does'nt display any changes to the column intended to sort in this case the first column (Order).
Any help will be appreciated thnx.
-rocky
/*********** CODE SNIP STARTS HERE *************/ <html xmlns:zk="http://www.zkoss.org/2005/zk"
xmlns:x="http://www.zkoss.org/2005/zul">
<zk:zscript>
class Comp implements Comparator {
private boolean _asc;
public Comp(boolean asc) {
_asc = asc;
}
public int compare(Object o1, Object o2) {
String s1 = o1.getChildren().get(0).getValue(),
s2 = o2.getChildren().get(0).getValue();
int v = s1.compareTo(s2);
return _asc ? v: -v;
}
}
Comp asc = new Comp(true);
Comp dsc = new Comp(false);
</zk:zscript>
<x:grid id="grid" width="500px" height="100px">
<x:columns sizable="true">
<x:column id="col" label="Order" sortAscending="${asc}"
sortDescending="${dsc}"/>
<x:column label="Head 1"/>
<x:column label="Head 2" align="center"/>
<x:column label="Head 3" align="right"/>
</x:columns>
<x:rows>
<x:row>
Orange
<x:listbox mold="select">
<x:listitem label="AB"/>
<x:listitem label="CD"/>
</x:listbox>
<x:datebox/>
<x:textbox rows="3"/>
</x:row>
<x:row>
Apple
<x:label value="A11"/>
<x:label value="A12"/>
<x:label value="A13"/>
</x:row>
<x:row>
Lemon
<x:checkbox checked="true" label="Option 1"/>
<x:checkbox label="Option 2"/>
<x:radiogroup>
<x:radio label="Apple"/>
<x:radio label="Orange" checked="true"/>
<x:radio label="Lemon"/>
</x:radiogroup>
</x:row>
<x:row>
Tomato
<x:checkbox checked="true" label="Option 1"/>
<x:checkbox label="Option 2"/>
<x:radiogroup orient="vertical">
<x:radio label="Apple"/>
<x:radio label="Orange" checked="true"/>
<x:radio label="Lemon"/>
</x:radiogroup>
</x:row>
</x:rows>
</x:grid>
/*********** CODE SNIP ENDS HERE *************/
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4091061
By: henrichen
Please post to bug list along with your testing codes. Thanks.
/henri
Asked: 2007-01-05 15:24:23 +0800
Seen: 225 times
Last updated: Jan 08 '07