PDA

View Full Version : [CLOSED] Summary Column Issue



shaileshsakaria
Apr 27, 2013, 1:22 PM
Hello,

I have used summary Column.

Now through code behind I am adding the records using following statement

MyStore.Add(customStoneList);

While Adding first time it calculates summary, but on second request while add, summary not affected.

For example I am adding 5 records in store it displays proper summary. While I am adding another 2 records then summary should calculate again but its not calculating.

Thanks
Shailesh

Daniil
Apr 29, 2013, 6:15 AM
Hi Shailesh,

Thank you for the report, but I can't reproduce with the test case below.

Please provide your test case.

Example

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

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

<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[] { 1 },
new object[] { 2 },
new object[] { 3 }
};
store.DataBind();
}
}

protected void Add(object sender, DirectEventArgs e)
{
Store store = this.GridPanel1.GetStore();

store.Add(new object[]
{
new object[] { 4 },
new object[] { 5 }
});
}

protected void AddMore(object sender, DirectEventArgs e)
{
Store store = this.GridPanel1.GetStore();

store.Add(new object[]
{
new object[] { 6 },
new object[] { 7 }
});
}
</script>

<!DOCTYPE html>

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

<style>
.x-grid-row-summary .x-grid-cell-inner {
font-weight : bold;
font-size : 11px;
background-color : #f1f2f4;
}
</style>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Button runat="server" Text="Add" OnDirectClick="Add" />
<ext:Button runat="server" Text="Add more" OnDirectClick="AddMore" />

<ext:GridPanel ID="GridPanel1" runat="server">
<Store>
<ext:Store runat="server">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="test" Type="Int" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel runat="server">
<Columns>
<ext:SummaryColumn runat="server" Text="Test" DataIndex="test" SummaryType="Sum" />
</Columns>
</ColumnModel>
<Features>
<ext:Summary runat="server" />
</Features>
</ext:GridPanel>
</form>
</body>
</html>

shaileshsakaria
May 08, 2013, 10:56 AM
Hi Danil,

Have you noticed here, after click on add or add more button, the summary not reflected , it remains "6" only, That was my issue.

Thanks
Shailesh

Daniil
May 08, 2013, 11:33 AM
I can't reproduce it using the test case above and the SVN trunk.

shaileshsakaria
May 08, 2013, 12:03 PM
Danil,

What do you mean by SVN trunk?

Thanks
Shailesh

Daniil
May 08, 2013, 12:19 PM
I mean that I use the Ext.NET sources from the trunk.
http://svn.ext.net/premium/trunk

What Ext.NET sources are you using?