Remote Paging using DataTable, Grid and Store Generated from Code behind
Hello.
I am trying to load records (sometimes up to 1000+) into different grids. Each grid is in a separate tab which makes rendering take a long time.
Is it possible to do remote paging if Datasource is a datatable generated from code behind and all components were also generated from code behind?
I've looked at several threads on this forum, but none of them have the same scenario I have. Usually the markup is already generated and a StoreRefresh event is defined in the markup.
I came across this thread but it's using DataSourceProxy which I believe is no longer available on Ext.Net 1.0:
http://forums.ext.net/showthread.php...ging-GridPanel
Code behind: I call several of this procedures because they all return different datasets.
Code:
public void GetInvalidData(string atype)
{
DataTable dt = new DataTable();
dt = GetTable(); //**--this calls a stored procedure and returns a datatable.
Store storeData = new Store();
storeData.DataSource = dt
storeData.ID = "storeID";
JsonReader rdr = new JsonReader();
rdr = GetReader((DataTable)storeData.DataSource);
storeData.Reader.Clear();
storeData.Reader.Add(rdr);
ExtJS.GridPanel gridDataDiff = new ExtJS.GridPanel();
gridDataDiff.Title = "Invalid Data";
gridDataDiff.ColumnLines = true;
gridDataDiff.ColumnModel.Columns.Add(new Column() { DataIndex = "SEC_ID", Header = "SEC_ID" });
gridDataDiff.ColumnModel.Columns.Add(new Column() { DataIndex = "SECDATA", Header = "SECDATA" });
gridDataDiff.ColumnModel.Columns.Add(new Column() { DataIndex = "SECMIN", Header = "SECMIN" });
gridDataDiff.SelectionModel.Add(new RowSelectionModel());
gridDataDiff.Store.Clear();
gridDataDiff.Store.Add(storeData);
storeData.DataBind();
storeData.AutoLoadParams.Add(new ExtJS.Parameter { Name = "start", Value = "0", Mode = ParameterMode.Raw });
storeData.AutoLoadParams.Add(new ExtJS.Parameter { Name = "limit", Value = "20", Mode = ParameterMode.Raw });
storeData.RemotePaging = false;
PagingToolbar pager = new PagingToolbar() { HideRefresh = true };
pager.StoreID = storeData.ID;
gridDataDiff.BottomBar.Add(pager);
storeData.RemoteGroup = false;
AddTab(gridDataDiff, this.tpnlData);
}
private void AddTab(ExtJS.GridPanel grid,TabPanel tabPanel)
{
ExtJS.Panel tabData = new ExtJS.Panel();
tabData.Title = grid.Title;
tabData.Items.Add(grid);
tabData.Layout = "fit";
tabData.Padding = 5;
tabData.Border = false;
//tabData.AddTo(this.tpnlData);
tabData.AddTo(tabPanel);
//this.tpnlData.SetActiveTab(0);
}
In aspx page, the only thing I have is the Tabpanel to which I add several tabs that has a grid on each one of them.
Code:
<ext:TabPanel ID = "tpnlData" runat="server" ClientIDMode="Static" AutoRender="false" Height="600"
EnableTabScroll="true">
<Items>
</Items>
</ext:TabPanel>
Thanks.