如何在SharePoint 2007列表中具有特定文本的行中添加颜色? [英] how to add a color to a line in sharepoint 2007 list that has a specific text?

查看:121
本文介绍了如何在SharePoint 2007列表中具有特定文本的行中添加颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在Sharepoint 2007列表中的行中添加颜色 如果在一个字段中包含特定文本?

I would like to know how to add a color to a line in sharepoint 2007 list if in one field there is a specific text contained ?

例如: 我有一个包含三个字段的列表:

for example : I have a list that have three fields:

1.id 2.名称 3.完整说明

1.id 2.name 3.full description

现在我只想向用户显示第一和第二字段.

now i want to show only the first and the second field to the user.

id名称

1 abc 2 edv

1 abc 2 edv

第二件事,我想给隐藏的行提供一种颜色(让我们说红色) 字段-完整说明",例如带有颜色"一词的文本.

second thing, i want to give a color (let say red) to a row that contains in the hidden field - "full description", a text with the word for example 'color'.

我找到了可以添加到aspx页面的javascript代码:

I found a javascript code that i can add to the aspx page :

(文档).ready(function(){ $ Text = $("td .ms-vb2:contains('color')"); $ Text.parent().css("background-color","red"); });

(document).ready(function(){ $Text = $("td .ms-vb2:contains('color')"); $Text.parent().css("background-color", "red"); });

,但只有在显示完整说明"的情况下,它才有效.

but it's only works if the the "full description" is shown.

有人可以给我一个主意吗?

can someone give me an idea ?

谢谢, 加迪姆

推荐答案

您是否考虑过使用条件格式创建数据视图?请参阅 http://office.microsoft.com/en-au/sharepointdesigner/HA100996241033 .aspx

Have you considered creating a data view with conditional formatting? See http://office.microsoft.com/en-au/sharepointdesigner/HA100996241033.aspx

那样,您就不必进行这种丑陋的JavaScript黑客攻击了:)

That way you won't have to do this ugly javascript hacking :)

这篇关于如何在SharePoint 2007列表中具有特定文本的行中添加颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆