Skip to Content
author's profile photo Former Member
Former Member

Sort Images in Table

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2005 at 05:36 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 19, 2005 at 06:02 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • author's profile photo Former Member
    Former Member
    Posted on Jun 25, 2009 at 06:42 AM

    Hi alex,

    Can you explain me how you stored the images in to the table...

    thanks,

    viswa

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.