:: Forum >>

datagrid - how to create sortable image link column?

I've been all of this forum getting myself confused and I'm refactoring someone else's code and that doesn't help.

I need to add a column:
* that is sortable
* can contain null (blank) values
* or image links that open in a new window

I've been able to add image links, but they do not sort. I was able to get them to sort as simple images.

We're using v5.2 (which noticeably faster, thanks)

The grid is being populated by a js array created from a PHP loop.

a full example would be great, as it's not all my code and it's kind of all over the place so I haven't got everything figured out.

Robert S.
Thursday, January 17, 2008
er.. I meant v2.5.1
Robert S.
Thursday, January 17, 2008
from friends of aw:

Robert S.
Thursday, January 17, 2008
How do you want to sort images?

In any case for a custom sort you have to make a custom format object. It converts cell text to 'value', which is then used for sorting -

var fmt = new AW.System.Format;

// value (used for sorting)
fmt.textToValue = function(text){
return ???; // something sortable :-)


grid.setCellFormat(fmt, columnIndex);

Alex (ActiveWidgets)
Thursday, January 17, 2008
the images represent true / false values

So we display an image link if resource is available blank if nothing.

I noticed that if I put just an image in the grid sorts off the alt tag. It would be nice if there was something like that for links as well.

Thanks for your quick response, we'll start implementing it immediately

Robert S.
Thursday, January 17, 2008

This topic is archived.

Back to support forum

Forum search