[CLOSED] Set a Command Columns Icon based on a Column Value

  1. #1

    [CLOSED] Set a Command Columns Icon based on a Column Value

    Hi all

    I need to set a Command Column Icon based on a Value (boolean)

    Here's what I did :

    Thats my Store

            <ext:Store ID="storeB" runat="server" SerializationMode="Complex">
                <Reader>
                    <ext:JsonReader IDProperty="BId">
                        <Fields>
                            <ext:RecordField Name="BordereauId" />
                            <ext:RecordField Name="Processed" Type="Boolean" >
                                <Convert Fn="prepareState"/>
                            </ext:RecordField>
                        </Fields>
                    </ext:JsonReader>
                </Reader>
            </ext:Store>
    Thats the Grid (a Part)

        
     <%--Processed Flag--%>
     <ext:Column ColumnID="Processed" DataIndex="Processed" Header="Processed" Width="120" Hidden="true" <Goupable="False" />
        <ext:CommandColumn Width="25" ColumnID="commandColProcessed">
            <Commands>
                <ext:GridCommand Icon="Decline" CommandName="cmdProcessedBordereau"/>
             </Commands>
        </ext:CommandColumn>
    And I struggle here, the Java Script:

        var prepareState = function(value, rec) {
            if (value != null) {
                if (value == true) {
                    
                    
                }
            }
        };
    How can I access the Icon in the Command Column ?

    Peter
    Last edited by Daniil; Sep 19, 2011 at 6:23 PM. Reason: [CLOSED]
  2. #2
    See the following sample
    http://examples1.ext.net/#/GridPanel/Commands/Prepare_Toolbar/

    To set new icon use 'setIconCls' method
    Vladimir Shcheglov
    Sr. Developer

Similar Threads

  1. Replies: 0
    Last Post: Jul 10, 2012, 9:33 AM
  2. Replies: 1
    Last Post: Nov 04, 2011, 8:51 AM
  3. 2 different command columns in gridpanel
    By abelvn in forum 1.x Help
    Replies: 2
    Last Post: Aug 15, 2011, 4:59 PM
  4. Replies: 12
    Last Post: May 05, 2011, 6:21 AM
  5. [CLOSED] Icon column in GridPanel based on column from store
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: May 12, 2010, 5:46 PM

Posting Permissions