I am trying to found what is the best practice for view-controller communication for case when I need for example filtering.
I have collection of items on page and filter control. I am filtering items by letter, status, etc... It is straightforward scenario, I am sending filter selected values to controller and controller gives back results to the page.
If you think about it, it is one direction cycle. View call controller with parameters(filter values), controller calls database and then fetch elements and give that elements to the view back. Is there any way to send to controller these elements and controller just to filter them and give filtered collection back to the view? Or maybe to shorten this trip to server, to give controller just id's of elements and controller to know which of elements to pull from database and then to filter them, give filtered collection back...
Bad practice? Some work around?
What do you think?
Thanks