Page 1 of 1

Sort Controller in MVC

Posted: June 24th, 2022, 5:19 pm
by smackie
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.

Re: Sort Controller in MVC

Posted: June 27th, 2022, 9:24 am
by JustinVanRegenmorter
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.
SortController.PNG
Then inside the SubMethod the original database service runs and does the sorting.
The attachment SubMethod.PNG is no longer available
When the UpdateElement service runs it will replace the entire table if you have it set to the HtmlId of the table.