PDA

View Full Version : [CLOSED] Buttons alignment on ButtonGroup



softmachine2011
May 31, 2012, 12:41 PM
Hi,

We would like to center all buttons inside a ButtonGroup:


<ext:ButtonGroup
runat="server"
Height="97"
Title="Actions"
HeaderPosition="Bottom"
Columns="1">
<Defaults>
<ext:Parameter Name="scale" Value="small" />
<ext:Parameter Name="iconAlign" Value="top" />
</Defaults>
<Items>
<ext:Button
runat="server"
Text="Header"
IconCls="add16">
</ext:Button>
<ext:Button
runat="server"
Text="Data"
IconCls="add16">
</ext:Button>
</Items>
</ext:ButtonGroup>

Is it possible?

Thanks in advance.

Daniil
May 31, 2012, 2:49 PM
Hi,

ButtonGroup internally uses TableLayout, you can set up respective setting in TableLayoutConfig.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>

<style type="text/css">
.my-button-group {
width: 100%;
}
</style>
</head>
<body>
<ext:ResourceManager runat="server" />

<ext:ButtonGroup
runat="server"
Height="97"
Title="Actions"
HeaderPosition="Bottom"
Columns="1">
<LayoutConfig>
<ext:TableLayoutConfig>
<TableAttrs Cls="my-button-group" />
<TDAttrs>
<CustomConfig>
<ext:ConfigItem Name="align" Value="center" Mode="Value" />
</CustomConfig>
</TDAttrs>
</ext:TableLayoutConfig>
</LayoutConfig>
<Defaults>
<ext:Parameter Name="iconAlign" Value="top" />
</Defaults>
<Items>
<ext:Button
runat="server"
Text="Header"
Icon="Accept"
ColSpan="1" />
<ext:Button
runat="server"
Text="Data"
Icon="Add"
ColSpan="1" />
</Items>
</ext:ButtonGroup>
</body>
</html>

softmachine2011
Jun 01, 2012, 8:53 AM
Thank you very much.