如何使用 HTML 和 Javascript 创建动态每周计划?
为周历创建基于表格的布局非常简单,其中 7 列代表一周中的每一天,不同行代表一周中的每个小时。我创建它没有问题。困难的部分是动态地用每日“事件”填充此表(我什至不确定如何静态地执行此操作)。
用户将可以访问他们想要添加到每周日程中的“事件”列表。并且它们需要动态添加到网页中。每个事件都有特定的开始和结束时间,并且可能发生在一周中的不止一天。我不确定如何将这些“事件”添加到我的表布局中,而不会遇到一堆行跨度问题(很多事件的长度不同,跨度不同的时间)。如果每个活动总是 1 小时,那就很容易了,但事实并非如此。
我正在考虑将每一天制作成一个带有隐藏小时列的单独表格。我仍然觉得这会导致一个巨大的混乱。有什么想法吗?
It's simple to create a table based layout for a weekly calendar with 7 columns for each day of the week and various rows for each hour of the week. I have no problem creating that. The hard part is filling in this table with daily 'events' dynamically (I'm not even sure how I would do this statically).
The user will have access to a list of 'events' that they would like to add to their weekly schedule. And they need to be added dynamically to the webpage. Each event has a specific start and end time, and may occur on more than one day of the week. I'm not sure how I could possibly add these 'events' to my table layout without getting into a bunch of rowspan problems ( a lot of the events are various lengths and span different hours ). It would be easy if each event was always 1 hour long, but that's not the case.
I was thinking of making each day a respective table with a hidden hour column. I still feel like this will result in a huge mess. Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么要重新发明轮子?
我想这涵盖了你所有的担忧。
http://arshaw.com/fullcalendar/
Why reinvent the wheel?
I think this covers all your concerns.
http://arshaw.com/fullcalendar/