Hi Vasudhaika,
Now I see that you need total count on server side. Well, the best way is sending this value as extra parameter of AjaxEvent.
Example
<%@ Page Language="C#" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!Ext.IsAjaxRequest)
{
this.Store1.DataSource = new object[]
{
new object[] {"test1"},
new object[] {"test2"},
new object[] {"test3"},
new object[] {"test4"},
new object[] {"test5"},
new object[] {"test6"},
new object[] {"test7"},
new object[] {"test8"},
new object[] {"test9"}
};
this.Store1.DataBind();
}
}
protected void Button_Click(object sender, AjaxEventArgs e)
{
int totalCount = int.Parse(e.ExtraParams["totalCount"]);
Ext.Msg.Alert("Total count", totalCount.ToString()).Show();
}
</script>
<!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>Coolite 0.8.X Example</title>
</head>
<body>
<form runat="server">
<ext:ScriptManager runat="server" />
<ext:Store ID="Store1" runat="server">
<Reader>
<ext:ArrayReader>
<Fields>
<ext:RecordField Name="test" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:GridPanel
ID="GridPanel1"
runat="server"
StoreID="Store1"
AutoHeight="true">
<ColumnModel runat="server">
<Columns>
<ext:Column Header="Test" DataIndex="test" />
</Columns>
</ColumnModel>
<BottomBar>
<ext:PagingToolbar runat="server" PageSize="3" />
</BottomBar>
</ext:GridPanel>
<ext:Button runat="server" Text="Get total count">
<AjaxEvents>
<Click OnEvent="Button_Click">
<ExtraParams>
<ext:Parameter
Name="totalCount"
Value="GridPanel1.getStore().getTotalCount()"
Mode="Raw" />
</ExtraParams>
</Click>
</AjaxEvents>
</ext:Button>
</form>
</body>
</html>