PDA

View Full Version : [CLOSED] Is it possible to merge grid columns on specific row in a grid.



PriceRightHTML5team
Aug 26, 2014, 10:22 AM
Hi,

Is it possible to merge grid columns on specific row. as shown in attached image highlighted in yellow.

http://forums.ext.net/attachment.php?attachmentid=14821&stc=1

Daniil
Aug 26, 2014, 3:40 PM
Hi @PriceRightHTML5team,

Unfortunately, there is no such the functionality.

If think about possible approaches to achieve that, I would try with a RowBody.

Example

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

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store store = this.GridPanel1.GetStore();
store.DataSource = new object[]
{
new object[] { "test", "test" },
new object[] { "test", "test" },
new object[] { "test", "test" }
};
}
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>

<style>
.my-row-body {
background-color: yellow;
}
</style>

<script>
var getAdditionalData = function(data, idx, record, rowData) {
if (idx === 1) {
rowData.rowBody = "something";
rowData.rowBodyCls = "my-row-body";
} else {
rowData.rowBody = "";
rowData.rowBodyCls = "x-hidden";
}

console.log(rowData);
};
</script>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:GridPanel ID="GridPanel1" runat="server" Height="200">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="test1" />
<ext:ModelField Name="test2" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Test 1" DataIndex="test1" />
<ext:Column runat="server" Text="Test 2" DataIndex="test2" />
</Columns>
</ColumnModel>
<Features>
<ext:RowBody runat="server">
<GetAdditionalData Fn="getAdditionalData" />
</ext:RowBody>
</Features>
</ext:GridPanel>
</form>
</body>
</html>