Oct 11, 2012, 9:06 PM
Infinite buffered scrolling grid- How to move paging scroller to new position from code?(finding proper record/page in dataset)
Hello, I have following problem. I have web site project in .aspx with aditional C# code behind. The web uses ext:GridPanel to show personal data from SQL database.Fragment of source code follows:
........................................
There are 1000records in person table in DB and grid works fine.But now I need implement FIND function,which allow user to find for instance all persons which last_name starting with string "Sm" for all Mr.Smith,.. etc.. and so I need show proper grid page starting with 1. person name Smith and move paging scroller to proper position e.g. I should procceed from my C# code similar action as user move paging scroller right to page with first Mr.Smith.. In other words I need to move to any record(grid row) which is not curently in Store cache. No additional filter to SQL SELECT is allowed. Please can anybody tell me,how to do it.. Many Thanks.P.
........................................
<asp:SqlDataSource
ID="SqlDataSource1"
runat="server"
ConnectionString="Data Source=(local);Initial Catalog=aSecure_pad;Integrated Security=True"
SelectCommand="
SELECT [last_name], [first_name], [pers_nr]
FROM [zkpers] ORDER BY [last_name],[first_name] "
/>
<ext:GridPanel ID="GridPanel1" runat="server" Title="Persons" Frame="true" Height="440" Width="810" >
<Store>
<ext:Store ID="Store1" runat="server" Buffered="true" PageSize="50" autoLoad="true" DataSourceID="SqlDataSource1" >
<Model>
<ext:Model ID="Model1" runat="server" IDProperty="EmployeeID">
<Fields>
<ext:ModelField Name="first_name" />
<ext:ModelField Name="last_name" />
<ext:ModelField Name="pers_nr" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<ColumnModel ID="ColumnModel1" runat="server">
<Columns>
<ext:Column ID="Column1" runat="server" Text="Last Name" Width="100" DataIndex="last_name" />
<ext:Column ID="Column2" runat="server" Text="First Name" Width="80" DataIndex="first_name" />
<ext:Column ID="Column3" runat="server" DataIndex="pers_nr" Text="Person Nr" Width="100" />
</Columns>
</ColumnModel>
<View>
<ext:GridView ID="GridView1" runat="server">
</ext:GridView>
</View>
<SelectionModel>
<ext:RowSelectionModel ID="RowSelectionModel1" runat="server" />
</SelectionModel>
<Features>
<ext:RowBody ID="RowBody1" runat="server" >
</ext:RowBody>
</Features>
</ext:GridPanel>
............................There are 1000records in person table in DB and grid works fine.But now I need implement FIND function,which allow user to find for instance all persons which last_name starting with string "Sm" for all Mr.Smith,.. etc.. and so I need show proper grid page starting with 1. person name Smith and move paging scroller to proper position e.g. I should procceed from my C# code similar action as user move paging scroller right to page with first Mr.Smith.. In other words I need to move to any record(grid row) which is not curently in Store cache. No additional filter to SQL SELECT is allowed. Please can anybody tell me,how to do it.. Many Thanks.P.
Last edited by Daniil; Oct 23, 2012 at 7:42 PM.
Reason: Please use [CODE] tags