Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplaying an Image/Icon inside an EXT.NET GridPanel Cell depinding on value
    primarykey
    data
    text
    <p>Greeting,</p> <p>I need to display an image/icon AND a value in an EXT.NET cell (of a gridpanel). The value comes from the datatable. The value can either be a string ‘good’ or ‘bad’ and resides in the column ‘Status’. </p> <p>For example: good accept.png or bad cancel.png.</p> <p>Layout:</p> <pre><code> &lt;ext:GridPanel ID="grid" runat="server"&gt; &lt;Store&gt; &lt;ext:Store ID="Store1" runat="server"&gt; &lt;Reader&gt; &lt;ext:ArrayReader&gt; &lt;Fields&gt; &lt;ext:RecordField Name="status" Mapping="Status" /&gt; &lt;/Fields&gt; &lt;/ext:ArrayReader&gt; &lt;/Reader&gt; &lt;/ext:Store&gt; &lt;/Store&gt; &lt;ColumnModel ID="ColumnModel1" runat="server"&gt; &lt;Columns&gt; &lt;ext:Column DataIndex="status" Header="Status" Width="160"&gt; &lt;/ext:Column&gt; &lt;/Columns&gt; &lt;/ColumnModel&gt; &lt;/ext:GridPanel&gt; </code></pre> <p>Now I have seen some exaples but I can’t seem to get the picture, I think it has something to do with this:</p> <pre><code>&lt;script type="text/javascript"&gt; function imgRenderer(value, meta, record, rowIndex, colIndex, store) { if(data == ‘good’) { return "&lt;img src='accept.png'/&gt;" } else (data == "bad") { return "&lt;img src='cancel.png'/&gt;" } } &lt;/script&gt; </code></pre> <p>More info: <a href="http://miamicoder.com/2009/displaying-an-image-inside-an-ext-js-gridpanel-cell-part-2/" rel="nofollow">http://miamicoder.com/2009/displaying-an-image-inside-an-ext-js-gridpanel-cell-part-2/</a> http://techmix.net/blog/2010/11/25/add-button-to-extjs-gridpanel-cell-using-renderer/</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload