Sort Controller in MVC
-
- Posts: 46
- Joined: August 26th, 2021, 2:02 pm
- Contact:
Sort Controller in MVC
I am attempting to use a sort controller in my MVC webpage; however the controller runs but the page does not reflect a change in the order. I am not sure if my controller is setup improperly or if I need some other service to update the page. I am using the update element service pointing to the name of the table but this is not working.
word count: 67
Tags:
-
- Posts: 576
- Joined: August 26th, 2021, 9:56 am
- Contact:
Re: Sort Controller in MVC
Hello Sheryl,
When setting up a sort controller you must make sure that the name of the database service is the same as in the model. We would recommend that you use a SubMethod and just have the database service in their so it can be called from both the model and any controller.
For example, when you setup a list using our List / Grid creation tool you can see that the Sort Controller calls a SubMethod and an UpdateElement service. Then inside the SubMethod the original database service runs and does the sorting. When the UpdateElement service runs it will replace the entire table if you have it set to the HtmlId of the table.
When setting up a sort controller you must make sure that the name of the database service is the same as in the model. We would recommend that you use a SubMethod and just have the database service in their so it can be called from both the model and any controller.
For example, when you setup a list using our List / Grid creation tool you can see that the Sort Controller calls a SubMethod and an UpdateElement service. Then inside the SubMethod the original database service runs and does the sorting. When the UpdateElement service runs it will replace the entire table if you have it set to the HtmlId of the table.
word count: 124