开发者

How to change the color of a task list row when the due date comes nearer

I have a task list and it has a column called Due Date. So when your Due Date 开发者_JS百科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?


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).

Here's a tutorial for creating conditional formatting rules in a DVWP, which may prove helpful.

http://blog-sharepoint.blogspot.com/2009/05/data-view-conditional-formatting-using.html


I'm just going to nod knowingly towards this post: Sharepoint webpart for conditional formatting?

And not remention the thing I mentioned over there that I feel slightly guilty about mentioning in the first place.


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.

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


There are third party add-ons(sharepoint highlight rows) that allows you highlight SharePoint list rows based on field values.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜