View Full Version : Placing icons in grid rows

1 Nov 2010, 12:18 PM
I'm using Ext Designer for prototyping, and I needed to place an icon on each row (in a single column) of the grid. I've followed the instructions for creating an XML DataStore (available in the Working With Data PDF - http://docs.sencha.com/designer/Designer-Data.pdf). I ran into a problem on the instructions for including an image where the URL was being displayed in the row as text, not as an image. To fix this I changed the content in the URL tag to HTML, like this:

<URL><![CDATA[<img src="images/monitor-screensaver.png" width="16" height="16" alt="User is logged in, but not active." />]]></URL>

Now to my question(s) -- While this approach works, is this the correct way to do this? Is there a better way to get this same result?

Any info is appreciated.

1 Nov 2010, 12:22 PM
I think this is an OK approach, but why not simply return the URL in the XML data, and then construct the img HTML tag in a TemplateColumn? That would be a better approach, and then you're not mixing data with markup.

P.S. If you want that image to actually show in the Designer, make it an absolute URL (remote site or local web server). You can revert to relative URL when running your application in an actual browser.

1 Nov 2010, 12:51 PM
That worked great! Thanks for the tip.