[CLOSED] How to set an image into GridPanel column on the client?

  1. #1

    [CLOSED] How to set an image into GridPanel column on the client?

    Hi,

    I would like to be able to change a column icon on the client. Right now, it's assigned during the column rendering as follows:

                    <ColumnModel runat="server">
                        <Columns>
                            <ext:Column DataIndex="ColumnIcon" MenuDisabled="true"
                                Sortable="false" Resizable="false" Hideable="false" Width="26">
                                <Renderer Fn="iconRenderer" />
                            </ext:Column>
                       </Columns>
                    </ColumnModel>
            var iconRenderer = function (value, metadata, record) {
                if (record.get("ColumnIcon") != "") {
                    value = String.format("<img src='{0}' />", Ext.net.ResourceMgr.getIconUrl(record.get("ColumnIcon")));
                }
                return value;
            };
    I'd like to use the iconRenderer function or some other logic to set or replace the icon after the column is rendered. Please suggest an approach.
    Last edited by Daniil; Jul 19, 2012 at 5:12 PM. Reason: [CLOSED]
  2. #2
    Hi,

    You should re-render that row, when the Renderer will be called again.

    1. Calling Record set method causes a row to be updated.
    record.set('ColumnIcon', 'new icon');
    2. Calling
    grid.getView().refreshRow(index);
    refreshes the row with the specified index.

    3. Calling
    grid.getView().refresh();
    just refreshes all rows.
  3. #3
    Thanks much, that was it! Please mark this thread as resolved.

Similar Threads

  1. [CLOSED] How to display an image in GridPanel column?
    By vadym.f in forum 1.x Legacy Premium Help
    Replies: 6
    Last Post: Feb 28, 2012, 1:15 PM
  2. Save as dialog on client side for image
    By vishal.jhala@gmail.com in forum 1.x Help
    Replies: 0
    Last Post: Aug 06, 2011, 8:02 PM
  3. [CLOSED] Rating Column Image
    By sharif in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 05, 2010, 9:41 PM
  4. [CLOSED] Call client function on image button press
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Feb 03, 2010, 8:34 AM
  5. Image and Text column in gridpanel
    By filipator in forum 1.x Help
    Replies: 0
    Last Post: Mar 16, 2009, 2:48 PM

Tags for this Thread

Posting Permissions