Grails: update view on data change

帅比萌擦擦* 提交于 2020-01-16 18:31:07

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!