:: Forum >>

Set cell image by URL (without css class)

How can I define an image by URL for specific cells using version 2.0 RC1? I have already searched through the forum & docs but couldn't find a suitable example.

obj.setCellImage("test") implies that a corresponding css class "aw-image-test" exists. This is hardly impossible to implement when you have a large number of different images.

The old V1.0 way of defining images does NOT work anyone.

// provide cells and headers text
obj.setDataProperty("text", function(i, j){return myData[i][j]});
obj.setDataProperty("image", function(i, j){return myData[i][4]});
(see /examples/grid/images.htm)

Alex, could you please provide an example how to achieve the same functionality in V2.0??
Tobias
Monday, February 6, 2006
In both v1 and v2 images are linked through CSS class, there are no changes here. If you wish to link to image via URL you have to create your own cell template. I would suggest starting with /lib/templates/imagetext.js and replacing image span with IMG element (also put call to getControlProperty('image') into src attribute instead of 'image' class).
Alex (ActiveWidgets)
Monday, February 6, 2006

This topic is archived.


Back to support forum

Forum search