admin管理员组文章数量:1313598
I'm working on an app that uses fullcalendar and displays Bootstrap popovers on events when they're clicked. This calendar is periodically refreshed with data from the server, retrieved by a poll. The problem I'm running into is that whenever this poll happens while a popover is active, all the events are rerendered and the div the popover was previously pointing to is orphaned, causing problems with our popover logic (scrolling, making sure only one popover is active at a time, etc).
One way to get around this is to remember which event had a popover active before the refresh and then just reattach the popover after the events have rerendered. Getting the ID of the event that needs the popover is no problem, but I can't seem to find a way to query fullcalendar for the fc-event div associated with a given event ID. The docs don't seem to contain any methods that would acplish this, and looking through the source hasn't turned up anything that looks like it would help.
Does anybody know a way to do this - to get fullcalendar to return the fc-event div for a certain event, given the event's ID? Have I overlooked something obvious?
I'm working on an app that uses fullcalendar and displays Bootstrap popovers on events when they're clicked. This calendar is periodically refreshed with data from the server, retrieved by a poll. The problem I'm running into is that whenever this poll happens while a popover is active, all the events are rerendered and the div the popover was previously pointing to is orphaned, causing problems with our popover logic (scrolling, making sure only one popover is active at a time, etc).
One way to get around this is to remember which event had a popover active before the refresh and then just reattach the popover after the events have rerendered. Getting the ID of the event that needs the popover is no problem, but I can't seem to find a way to query fullcalendar for the fc-event div associated with a given event ID. The docs don't seem to contain any methods that would acplish this, and looking through the source hasn't turned up anything that looks like it would help.
Does anybody know a way to do this - to get fullcalendar to return the fc-event div for a certain event, given the event's ID? Have I overlooked something obvious?
Share Improve this question asked Nov 4, 2013 at 19:27 Ryan MitchellRyan Mitchell 1,4101 gold badge14 silver badges23 bronze badges1 Answer
Reset to default 7You could just set the event-id as a data-attr on the element when the data is refreshed. Then it's simple jQuery-logic to find the event when the data is refreshed.
You have a method eventRender you can use for this.
http://arshaw./fullcalendar/docs/event_rendering/eventRender/
本文标签: javascriptGet fullcalendar fcevent div by idStack Overflow
版权声明:本文标题:javascript - Get fullcalendar fc-event div by id - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741942672a2406232.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论