PDA

View Full Version : [CLOSED] Set Button-toogle in gridpanel



legaldiscovery
Sep 12, 2013, 6:56 AM
how can i use toogle button in gridpanel column?

Thanks in advance

Daniil
Sep 12, 2013, 8:39 AM
Hi @legaldiscovery,

You can use a ComponentColumn.

<ext:ComponentColumn runat="server">
<Component>
<ext:Button runat="server" EnableToggle="true" Text="Toggle" />
</Component>
</ext:ComponentColumn>

However, it is not enough. A toggle state will be erased if refresh the GridPanel (for example, it happens after sorting). So, you might need to maintain the Buttons' state. For that you can define an individual ModelField. Record a Button's state in that ModelField when that Button is being clicked. You can restore that state in a ComponentColumn's Bind listener. It should fire on each refresh of the GridPanel.