YUI 日历:获取当前页面/pageChangedEvent
我正在开发一个使用 GPS 数据的应用程序。该应用程序的一部分是一个日历,它显示数据可用于特定设备的日期。然后我们使用 YUI 日历来直观地显示这一点。
对我们服务器的调用如下所示:
http://example。 com/listgpsdates?device_id=xx&year=2009&month=11
这将返回 2009 年 11 月的可用数据的 JSON 数组。我将其与日历的自定义渲染堆栈一起使用来显示哪些日期具有可用数据以及哪些日期将返回数据。当然,注册了一个 selectedEvent 监听器,它实际上检索特定日期的 GPS 数据并将其放在地图上。
我尝试加载设备的所有日期,而不将其限制为一个月,但速度相当慢 - 通过从完整数据表中选择不同的值来加载可用日期。我希望能够在月份更改(或设备更改)时向服务器发出请求,仅针对该月,并适当更新日历。
读完Calendar API后,我得出的结论是,没有办法获取当前显示的月份+年份(多个月会不会有问题?)。当我订阅changePageEvent 时,我只得到一个空数组作为参数。我搜索并看到了一些有关changePageEvent的帖子,但即使更新到最新版本(2.8.0r4)后,我也没有得到changePageEvent的参数。
我想日历中必须有一个内部变量来跟踪当前页面/日期,但即使当前没有选择的日期,我也需要访问它。
感谢您的帮助!
I am working on an application which works with GPS data. Part of the application is a calendar which displays dates for which data is available for a particular device. We then use the YUI Calendar to display this visually.
The call to our server looks something like this:
http://example.com/listgpsdates?device_id=xx&year=2009&month=11
This would return a JSON array of days in Nov. 2009 for which data is available. I use that along with the Calendar's custom rendering stack to show which dates have available data vs. those that would return data. And, of course, there is a selectedEvent listener registered which actually retrieves the GPS data for a particular day and puts it on a map.
I have tried to load all the dates for a device without limiting it to a month, but it is rather slow - the available dates are loaded by selecting distinct values from the full data table. I would like to be able to just make a request to the server when the month changes (or the device changes), just for that month, and update the calendar appropriately.
After reading the Calendar API, I concluded that there is no way to get the month + year that is currently displayed (could it be problematic for multiple months?). And when I subscribe to the changePageEvent, I am only getting an empty array for the arguments. I have searched and seen a few posts about the changePageEvent, but even after updating to the latest version (2.8.0r4), I am not getting the arguments for the changePageEvent.
I suppose there must be an internal variable in the Calendar that keeps track of the current page / date, but I need access to this even if there are no currently selected dates.
Thanks for any help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
仅供参考,我在这里发布了一条回复(对您的 yuilibrary 帖子):
http://yuilibrary.com/forum/viewtopic.php?f=89&t=1817&p=5914#p5914
问候,
萨廷
FYI, I posted a response (to your yuilibrary post) here:
http://yuilibrary.com/forum/viewtopic.php?f=89&t=1817&p=5914#p5914
Regards,
Satyen