Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
415
Server-side paging/filtering/sorting with odata
posted

I have a MVC application where I am using iggrid and data is loaded using OData. Everything works fine but the problem comes when I enter some text in filtering for any column and try to reload the page with copy and paste to new browser window. It works fine if I filter records and navigate to another page using paging buttons. I have integrated this grid with history.js so all changes are pushed to browser url.

If I copy the url and paste it in new browser, then it always shows the first page even though URL says page=22. The reason it shows as:

User paste this URL in browser and hit enter:
http://localhost:6011/users/Index/?page=3&filter=LegalName_contains_test

OData goes to the server with this info to retrieve data:
http://server/GridData/list?searchString=9900&%24orderby=ClientId+asc&%24skip=0&%24top=18&%24inlinecount=allpages&%24expand=Links&pk=PKey&_=1422479440417

Then again it goes to server to get data for 3rd page. this time it added the SKIP parameter value
http://server/GridData/list?searchString=9900&%24orderby=ClientId+asc&%24skip=18&%24top=18&%24inlinecount=allpages&%24expand=Links&pk=PKey&_=1422479440418

Then it goes again to the server for filtered text. this time skip is again changed to 0.
http://server/GridData/list?searchString=9900&%24orderby=ClientId+asc&%24filter=indexof(tolower(LegalName)%2C'test')+ge+0&%24skip=0&%24top=18&%24inlinecount=allpages&%24expand=Links&pk=PKey&_=1422479440419

 

Now the grid data is correct but instead of showing 3rd page in the footer grid paging area, it show page 1.

Another issue is for one page load, it goes to the server multiple time for each type of expression i.e. paging, sorting, filtering, etc.

Can you please help on this?

 

Parents
No Data
Reply
  • 23953
    Offline posted

    Hello Sarojanand,

    I guess you follow the approach from our sample http://igniteui.com/grid/history/, right?

    Both of your issues are related to the way you're creating the grid. Unfortunately I cannot make any assumptions without looking at some code.

    Is it possible for you to create an isolated sample for me to investigate?

    Thanks in advance,

    Martin Pavlov
    Infragistics, Inc.

Children