PDA

View Full Version : [CLOSED] ButtonAlign in ext:ButtonGroup issue



Bert76
Nov 18, 2014, 3:15 PM
Hi,
is there a reason why I can't use ButtonAlign in a ext:ButtonGroup? I tried it but it doesn't do anything.



<ext:ButtonGroup ID="ButtonGroup2" runat="server" ButtonAlign="Center">
<Items>
<ext:Button ID="btnSubmit" runat="server" Text="Submit Application" Icon="Disk" OnClientClick="#{btnSubmit}.disable();return true;">
<DirectEvents>
<Click OnEvent="btnSubmit_Click">
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="btnBack" runat="server" Text="Back to Search" Icon="RewindBlue" OnClientClick="#{btnBack}.disable();redirect();" />
<ext:Button ID="btnHelp" runat="server" Text="Help" Icon="Information" OnClientClick="helpme();" />
</Items>
</ext:ButtonGroup>

Did I do something wrong?

Thanks,
Bert

Daniil
Nov 18, 2014, 3:34 PM
Hi Bert,

The ButtonAlign property's destination is a bit different. It is for a Panel's Buttons.

<ext:Panel runat="server" ButtonAlign="Center">
<Buttons>
<ext:Button runat="server" Text="Button 1" />
<ext:Button runat="server" Text="Button 2" />
<ext:Button runat="server" Text="Button 3" />
</Buttons>
</ext:Panel>

To align an Items collection you should use some Layout.

Example

<ext:ButtonGroup runat="server" Width="500">
<LayoutConfig>
<ext:HBoxLayoutConfig Pack="Center" />
</LayoutConfig>
<Items>
<ext:Button runat="server" Text="Button 1" />
<ext:Button runat="server" Text="Button 2" />
<ext:Button runat="server" Text="Button 3" />
</Items>
</ext:ButtonGroup>

Bert76
Nov 18, 2014, 5:46 PM
Great! that is exactly what I wanted,

Thanks Daniil.