list 如何在截止日期临近时更改任务列表行的颜色
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5109150/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to change the color of a task list row when the due date comes nearer
提问by user388969
I have a task list and it has a column called Due Date. So when your Due Date draws new, the row changes to the color orange, and when the Due Date is passed, then it changes to red. So it is done dynamically comparing the Current Date to Due Date.
我有一个任务列表,它有一个名为截止日期的列。因此,当您的截止日期绘制新时,该行更改为橙色,而当截止日期过去时,它会更改为红色。所以它是动态比较当前日期和截止日期的。
Has anyone accomplished this kind of solution?
有没有人完成过这种解决方案?
采纳答案by James Love
I'd recommend the use of SharePoint Designer to build a Data View Web Part over using JavaScript (which is reliant on being injected via a CEWP, or via the masterpage).
我建议使用 SharePoint Designer 来构建数据视图 Web 部件,而不是使用 JavaScript(这依赖于通过 CEWP 或母版页注入)。
Here's a tutorial for creating conditional formatting rules in a DVWP, which may prove helpful.
这是在 DVWP 中创建条件格式规则的教程,可能会有所帮助。
http://blog-sharepoint.blogspot.com/2009/05/data-view-conditional-formatting-using.html
http://blog-sharepoint.blogspot.com/2009/05/data-view-conditional-formatting-using.html
回答by Stu Pegg
I'm just going to nod knowingly towards this post: Sharepoint webpart for conditional formatting?
我只是有意地向这篇文章点点头: Sharepoint webpart for conditional format?
And not remention the thing I mentioned over there that I feel slightly guilty about mentioning in the first place.
并且不要重复我在那里提到的事情,我对首先提到的事情感到有点内疚。
回答by Raymond
There are third party add-ons(sharepoint highlight rows) that allows you highlight SharePoint list rows based on field values.
有第三方加载项(sharepoint highlight rows)允许您根据字段值突出显示 SharePoint 列表行。
回答by EvgK
You can add javascript to the target page, where loop through all rows (), looking in DueDate column and mark that rows as you wish. This is the simpliest solution I know. For achieve this you need to look to target page HTML markup.
您可以将 javascript 添加到目标页面,其中循环遍历所有行 (),查看 DueDate 列并根据需要标记该行。这是我所知道的最简单的解决方案。为此,您需要查看目标页面 HTML 标记。
UPD: You didn't say what Sharepoint version you are using. There is a better solution for 2010, explore this link: http://www.sharepoint.stackexchange.com/questions/7478/highlight-row-color-based-on-field-values-in-sharepoint-2010-list-view
UPD:您没有说明您使用的是什么 Sharepoint 版本。2010 年有更好的解决方案,请浏览此链接:http: //www.sharepoint.stackexchange.com/questions/7478/highlight-row-color-based-on-field-values-in-sharepoint-2010-list-看法