View Full Version : [CLOSED] Remote Paging using Store

Oct 30, 2014, 5:48 PM
Hi Danil,

I have been using remote pagination to achieve the database pagination,

we have a search button that will pull up only the records based on my search criteria and startIndex and EndIndex of the page index records..

However, this is been working fine for next,last etc....

But not working when we are in different page index..,

Let's consider when i switch to 3rd page or any other page except first Page.. then again Search with different criteria using search button ,
we noticed that e.Start will remains same even after click on search button, expecting that it is reset to 0 value for new search..

i have used store1.reload() to refresh store..

here is the code :

<ext:Store ID="store1" runat="server" RemoteSort="false" AutoLoad="true"
PageSize="50" OnReadData="store1_RefreshData" WarningOnDirty="false">
<ext:Parameter Name="start" Value="0" Mode="Raw" />
<ext:Parameter Name="limit" Value="50" Mode="Raw" />
<ext:PageProxy />
<ext:Model ID="Model5" runat="server" >
<ext:ModelField Name="company" />
<ext:ModelField Name="Price" />
<ext:ModelField Name="Location" />


<ext:Button ID="btnSearch" runat="server" Text="Search" Width="80">
<Click Handler="App.direct.Search()" />

<ext:GridPanel Id="GridPanel1" runat="server" >



Server Code :

Public StartIndex As Integer = 1
Public LastIndex As Integer = 51
Public TotalRecordCount As Integer = 0
Public Sub store1_RefreshData(ByVal sender As Object, ByVal e As StoreReadDataEventArgs)

StartIndex = e.Start
LastIndex = e.Start + e.Limit + 1
Dim p As PageProxy = storeRecipients.Proxy(0)
p.Total = TotalRecordCount
End Sub
<DirectMethod> _
Public Sub Search()
End Sub
Public sub SearchData(ByVal stidex as Integer,ByVal ltIndex as Integer)
'' load logic .......
end sub

Please suggest me how to reset the e.Start on new search...

Oct 31, 2014, 9:48 AM
Hi @iansriley,

Please replace

<Click Handler="App.direct.Search()" />

<Click Handler="App.store1.loadPage(1);" />

It also allows you to get rid of the Search DirectMethod and that excessive round trip to server.

Oct 31, 2014, 10:26 AM
This is working fine, Thanks Danil,

mark the ticket as closed