Nakataa Kokuyo wrote:Good day,
I'm about developing a solution, which include features like sorting with different criteria based on user options (dropdown) and pagination for product review from customers.
My question for sorting,
a ) should I fetch all review data and append it to a designated DIV by hiding it using CSS, and show it by applying jQuery filter and display the necessary when user select specific option ?
b) I should do an ajax call when user select the option by having logic in controller to filter and return me necessary data?
c) When doing pagination, user click on specific page number, would it better to have a call to controller to query and return necessary data or I can append all data in DIV and making all page number by divide it with total item per page, when user click on number, i use jQuery to pick the necessary data to display out to user.
which approach(putting all data into client/browser or separate call for specific set of return data) is better and what is the pro and cons of it ?
Thanks in advance !
It will be much simpler to use ajax ( option b). All the web frameworks I've worked with (since the age of ajax) use this approach. SO much simpler than downloading all of it, hiding some of it and then using the division you are proposing to know which to hide.