Jun 04, 2020, 6:09 PM
Need help: Using DirectMethod to set hidden property for ImageCommand
I have a grid with a few columns. One of these columns has two ImageCommand "Pass" and "Fail" respectively. I want both of these commands be either hidden (disabled if possible) if a certain criteria is met.
NOTE: If the prepare command is written like this: "command.hidden=false;" the ImageCommands shows up. If its true it doesn't show up which leads me to understand that the issue is in the DirectMethod. Of course, I have already made sure that the method is getting called and executed correctly by using a breakpoint.
I am searching for a way to make my commands hidden depending on a property (which can only be calculated trough the code behind).
Thanks in advance for anyone who might try to solve this issue with me.
<ext:Column runat="server" Text="Result" DataIndex="Result" Flex="1" MinWidth="180">
<Commands>
<ext:ImageCommand CommandName ="Pass" Icon="Accept" Text="Pass" >
<ToolTip Text="Pass" />
</ext:ImageCommand>
<ext:ImageCommand CommandName="Fail" Icon="BulletCross" Text="Fail">
<ToolTip Text="Fail" />
</ext:ImageCommand>
</Commands>
<PrepareCommand Handler="command.hidden=App.direct.IsBuildClosedOrValidated();"/>
<DirectEvents>
<Command OnEvent="TestReportStepResult_Click">
<EventMask ShowMask="true" />
<ExtraParams>
<ext:Parameter Name="Id" Value="record.data.Id" Mode="Raw" />
<ext:Parameter Name="Command" Value="command" Mode="Raw" />
</ExtraParams>
</Command>
</DirectEvents>
</ext:Column>
The DirectMethod returns a boolean value. However, regardless of whether the DirectMethod returns true or false, the commands are always hidden.NOTE: If the prepare command is written like this: "command.hidden=false;" the ImageCommands shows up. If its true it doesn't show up which leads me to understand that the issue is in the DirectMethod. Of course, I have already made sure that the method is getting called and executed correctly by using a breakpoint.
I am searching for a way to make my commands hidden depending on a property (which can only be calculated trough the code behind).
Thanks in advance for anyone who might try to solve this issue with me.