Infinite buffered scrolling grid - How to move paging scroller to new position from code programatically?

  1. #1

    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:
    ........................................
         <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
  2. #2
    If i understand it correctly, the only thing you need is a function that'll scroll the page, right? If you could get the offset between the current scroller position and position of the element you're looking for then you could maybe try using the Element.Scroll function? Have you tried looking at the Ext.NET reference?
  3. #3
    Quote Originally Posted by HemoGoblin View Post
    If i understand it correctly, the only thing you need is a function that'll scroll the page, right? If you could get the offset between the current scroller position and position of the element you're looking for then you could maybe try using the Element.Scroll function? Have you tried looking at the Ext.NET reference?
    Hello Hemogoblin, thank you very much for your help. Yes the only thing I need is to move to proper record in grid.The problem is that grid uses Store which is buffered and so in store cache is only a small amount of records( pagesize=50) and after user clicks on button FIND Person, I dont know how to scroll grid to proper page/position(how to force Store object to read proper records from SQL server and Gridpanel to show user proper page)..
  4. #4
    Quote Originally Posted by pelmo View Post
    Hello Hemogoblin, thank you very much for your help. Yes the only thing I need is to move to proper record in grid.The problem is that grid uses Store which is buffered and so in store cache is only a small amount of records( pagesize=50) and after user clicks on button FIND Person, I dont know how to scroll grid to proper page/position(how to force Store object to read proper records from SQL server and Gridpanel to show user proper page)..
    Well, it seems that i can't help you. However, you should try posting your question to Stack Overflow. I bet you'll find your answer there, it's very popular QA server where nearly everyone gets the answer.

Similar Threads

  1. [OPEN] [#38] Combobox with infinite scrolling
    By Leonid_Veriga in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Nov 17, 2012, 12:38 AM
  2. [CLOSED] Infinite Scrolling
    By rnachman in forum 2.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 09, 2012, 5:03 PM
  3. [CLOSED] Infinite Scrolling with MVC
    By RCN in forum 2.x Legacy Premium Help
    Replies: 14
    Last Post: Apr 12, 2012, 6:27 PM
  4. [CLOSED] Infinite Scrolling Grid with GridFilter feature - JavaScript Error
    By MacGarnicle in forum 2.x Legacy Premium Help
    Replies: 8
    Last Post: Apr 04, 2012, 2:06 PM
  5. [CLOSED] Buffered Grid View Scrolling
    By bethc in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Dec 02, 2009, 7:29 AM

Tags for this Thread

Posting Permissions