问题
What I would like to do is to update a .gsp page on data is change.
Something like this: http://weichhold.com/2009/07/20/updating-multiple-page-fragments-with-grails-and-ajax/ but here the content page doesn't change on data changes.
There is a easy way to do this?
回答1:
The usually approach to updating the UI without a complete page refresh is through Grails AJAX calls.
However based on the limited information you have provided, I think you would need to implement some sort of polling mechanism to periodically call you server to determine if there is new data to render.
Here is a jQuery Plugin to do what I have suggested
Here is a stackoverflow question where a similar solution is coded directly in javascript
来源:https://stackoverflow.com/questions/4097790/grails-update-view-on-data-change