In the view template of my parent page I want to display all names and some basic data of the child pages as a table. And I want to sort that table and filter it.
The only way I see is simply add manual links in the table headers like (<a href="?sortfield=XYZ">XYZ</a>) and process the parameter in the template code before getting and displaying the data. Is that right?
Is there a best practice (piece of code, helper class, etc.) to build the full url with parameters? There might be an arbitray number of other parameters like filter or paging info that also have to be in the generated URL.
I found that example on asp.net, but as I understand the umbraco architecture it is not possible to use Html.ActionLink unless you use Custom controllers (Hijacking Umbraco Routes)? If anybody has a better solution, please tell me.
I found that example on asp.net, but as I understand the umbraco
architecture it is not possible to use Html.ActionLink unless you use
Custom controllers (Hijacking Umbraco Routes)?
So why don't you do that? You can just create a (custom) SurfaceController which you can use right?
Why I don't do that? Because filtering, sorting and paging seems to me such a common and frequent scenario that I doubted the hijacking is the right way to do it... in the documentation hijacking routes is more described as a last resort way to solve things?
Route hijacking is quite common, at least from my experience.
What i would do in you situation is just create the table from the Children-data en use JavaScript to handle sorting and filtering. But that might be quite hard with an arbitrary number of filters
This posting is some months old. Meanwhile I've gained more experience in Umbraco. I would say that Child-Actions is the solution, or generally passing the parameters via GET or POST in a form. Hijacking Routes is also possible, but I wouldn't prefer it.
Sorting and Filtering tables in view template
Hi,
In the view template of my parent page I want to display all names and some basic data of the child pages as a table. And I want to sort that table and filter it.
The only way I see is simply add manual links in the table headers like (
<a href="?sortfield=XYZ">XYZ</a>
) and process the parameter in the template code before getting and displaying the data. Is that right? Is there a best practice (piece of code, helper class, etc.) to build the full url with parameters? There might be an arbitray number of other parameters like filter or paging info that also have to be in the generated URL.I found that example on asp.net, but as I understand the umbraco architecture it is not possible to use Html.ActionLink unless you use Custom controllers (Hijacking Umbraco Routes)? If anybody has a better solution, please tell me.
Thanks, Stephan
So why don't you do that? You can just create a (custom) SurfaceController which you can use right?
Why I don't do that? Because filtering, sorting and paging seems to me such a common and frequent scenario that I doubted the hijacking is the right way to do it... in the documentation hijacking routes is more described as a last resort way to solve things?
Route hijacking is quite common, at least from my experience. What i would do in you situation is just create the table from the Children-data en use JavaScript to handle sorting and filtering. But that might be quite hard with an arbitrary number of filters
This posting is some months old. Meanwhile I've gained more experience in Umbraco. I would say that Child-Actions is the solution, or generally passing the parameters via GET or POST in a form. Hijacking Routes is also possible, but I wouldn't prefer it.
is working on a reply...