Question

I have a ImageCommandColumn inside a ext Grid. ImageCommandColumn has a attribute named DataIndex

Based on its value I wan to show or hide the Icon of the ext:ImageCommand

if the value is empty then the Icon="None" otherwise Icon="Picture"

 <ext:ImageCommandColumn ColumnID="imgActivityPatient" Width="70px" DataIndex="ACTIVITY_PATIENT_IMAGEID" Header="Picture" Align="Center" Css="padding-left:30px;">
                    <Commands>
                        <ext:ImageCommand CommandName="View" Icon="Picture">
                            <ToolTip Text="Show Picture" />
                        </ext:ImageCommand>
                    </Commands>
                </ext:ImageCommandColumn>

I cant find a way to do this. please anyone here would help me?

N:B: the DataIndex value can be retrieved by record.data.ACTIVITY_PATIENT_IMAGEID

Was it helpful?

Solution

You need to listen PrepareCommand event and hide the command in the handler.

Take a look at the following example and the prepareCommand function: http://examples.ext.net/#/GridPanel/Commands/Prepare_Commands/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top