In this one I am going to add one more important and most used functionality i.e. paging in sencha touch List. This thing you will need when we have lots more data in our table and we want to load the data at demand otherwise if you load all your data at a time, the application can be hang or unwanted result(s) can come. So let’s move to implement one of the interesting functionality.
First let’s do modification in ASP.Net MVC Web API.
Add a Helper class :
This helper class is created for getting generic list by page no.
Modify controller Get action in MVC Web API
This Get method takes search value and page no as a parameter and returns the list of students by using Helper class.
Next do modification in Sencha Touch (Sencha Architect) app:
Modify List View:
Here I add a paging plugin in List and set its autopaging property to true. I also added a custom method isListEnd in order to check whether more student records exists or not in the store.
Then add an initialize method of view which binds the isListEnd method to the store load event. isListEnd method calls every time when ever the data is from the server in the store.
Modify store (Student)
Here I set the pageSize property of Store to 10. You can change or set it according to your need.
Now run an application and hit the search button it will only load ten records first time and when you scroll the list, it will fetch more data from the server:
You can also search the record of the student by typing your search text:
Thanks for reading this article. I think this will helps you a lot.