客户端 JavaScript 或服务器端
我有一个报告页面,可以根据某些条件过滤客户并在浏览器上显示他们的详细信息。如果客户的注册日期在某个日期(例如 2011 年 1 月 1 日)之后,我需要用不同的颜色突出显示该日期。我想知道执行此操作的最佳方法是什么,因为有大约 800 条记录需要显示。
如果我检查客户端的日期 - javascript,我会检查并将其与每条记录的特定日期进行比较,这会大大减慢处理速度
如果我在服务器端运行计划脚本并在数据库中设置一个标志来指示将设置的错误记录显示的颜色,我该如何做到这一点一种对于记录的其他字段可扩展的方式??
更新
感谢您的精彩回答。因此,如果我想扩展它以包括记录的所有字段,是否可以在单独的表中为每个字段存储一个标志,然后检查该表以查看为每个记录设置了哪些标志并相应地更改显示??
I have a report page that filters customers based on some criteria and displays their details on the browser. If the registration date of the customer is after a certain date say 1st January 2011, I need to highlight the date in a different color. I am wondering what is the best way to do this as there are around 800 records to display.
if i check the date on the client side - javascript , i would be checking and comparing it with the certain date for each record which would slow down processing a lot
if i run a scheduled script on the server side and set a flag in the database to indicate erroneous records which will set the color on display, how can i do this in a way which is scalable for other fields of the record??
UPDATE
Thanks for the great answers. So if I want to scale this to include all the fields of the record, would it be right to store a flag for each field in a separate table and then check the table to see which flags are set for each record and accordingly change the display??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在情况 2 中,当您在服务器端标记记录时,如果您使用 JSP 和 JSTL-Tag 库,则可以像这样完成输出:
警告:未经测试
如果您想根据以下内容标记条目其他记录,那么您必须调整设置标志的脚本。
In case 2, when you mark your records on the server side, output can be done like that if you are using JSPs and the JSTL-Tag library:
Warning: UNTESTED
If you want to mark entries depending on other records, then you have do adapt the script that sets the flag.