on 12-19-2005 4:57 AM
Hi,
I have a coulm of images in table . and if i click on the header of that coulm , i should get it sorted..is there any way to sort images in coulmn..
Thanks in advance for a quick answer..
Regards
AD
Hi alex,
Can you explain me how you stored the images in to the table...
thanks,
viswa
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I tried the table sorter utility.but it is sorting only if there are text property.
so it is sorting according to the text.
then i tried the code
Comparator comparator = new Comparator()
{
public int compare(Object x1, Object x2)
{
IResultNodeElement e1 = (IResultNodeElement ) x1;
IResultNodeElement e2 = (IResultNodeElement ) x2;
return e1.getDs().compareTo(e2.getDs());
}
};
wdContext.nodeResultNode().sortElements(comparator);
Then it is sorting in one order..is there any way to sort it in other order..
Regards
AD
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alex,
Just use other attribute for sorting. The only requirement is that attribute type implements comparable interface. This is true for majority of built-in WD simple types (time, date, all numeric, string)
So the last line should be like
e1.getLastModified.compareTo( e2.getLastModified() );
Also for some attributes do not forget to check nulls, i.e.
if ( e1.getLastModified() == null )
return e2.getLastModified() == null ? 0 : -1;
e1.getLastModified.compareTo( e2.getLastModified() );
VS
Hi AD,
On what basis you want to sort the Images ?
May be you can tableSorter utility to sort the images by filename.
Regards,Anilkumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.