开发者

Updating data with information received from the view (Grails)

开发者 https://www.devze.com 2023-03-12 00:54 出处:网络
I am writing a Grails app and I have a quick question about the best way to do something. My controller has 2 lists of data, both of which are displayed on the view in separ开发者_StackOverflowate HTM

I am writing a Grails app and I have a quick question about the best way to do something. My controller has 2 lists of data, both of which are displayed on the view in separ开发者_StackOverflowate HTML tables. What I want to do is to have a button that will allow you to move an item from one list to the other. What is the best way to do this?

I have done some research and using some form of AJAX seems to be the general consensus on the best way to do this. Is there any other way? The heart of the problem is that I can't figure out how to update the data contained in the contoller based on the button the user presses in the view.

Thanks


I solved this by just updating the model to reflect the new lists and rerendering the page

0

精彩评论

暂无评论...
验证码 换一张
取 消