PDA

View Full Version : grid icons



heidtmare
16 Apr 2007, 6:41 AM
I know its here somewhere, but could somebody point me in the right direction to how to get icons to show up in a grid built off an xml input?

How would i go about getting something like this:
<stuff>
<stuff_image><![CDATA[ <img src="./images/foobar.gif" /> ]]></stuff_image>
...
<stuff>
into a grid?

is there a way to just say:
<stuff>
<stuff_image>foobar.gif</stuff_image>
...
<stuff>
and have the grid know what to do?

Micha
16 Apr 2007, 6:50 AM
define in your grid.ColumnModel where your pic column is
{header:"maybe Pic", dataindex: 'foo', renderer: myPicRenderer}

and later

function myPicRenderer(value){
return '<img src=\"yourPath' + value +' \" />';
}

heidtmare
16 Apr 2007, 6:58 AM
Thanks.
Worked like a charm :)