如何突出显示共享点中的列表项 [英] how to highlight list items in sharepoint

查看:58
本文介绍了如何突出显示共享点中的列表项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好

我该如何在以下情况下实现这一目标呢?

我在该列表中有列表A,但我没有几列.例如-id,出生日期,姓名,开始日期,结束日期.

如果我将数据添加到上面的列表中.一旦添加数据,我将再次添加相同的数据列表.如果我根据ID对所有数据进行排序,则旧数据不应突出显示列,而新数据应突出显示.

我可以对数据进行排序,但不能基于id对列进行排序和突出显示.

解决方案

我们可以使用REST API按ID排序,并使用jQuery突出显示最新数据.

我们需要添加脚本编辑器" Web部件,将我们的JavaScript代码插入列表页面.

这是一个简单的演示供您参考.

下面是我的列表.

下面是我的代码,该代码将用红色突出显示最新的列表项.

< script type =" text/javascript"src =" https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js"</script>
< script type =文本/javascript">
    var url ="http://sp/sites/DevSite/_api/web/lists/getbytitle('MyCustomList')/items?


orderby = ID desc; var itemID; var interval;


(function(){


Hello,

how can i achive below scenario.its totaly out of the box

i have list A in that list, i have few columns. example -id,date of birth,name,start date,end date.

if i add a data to the above list. once data added i will added same data again the list. if i sort all data based on id,old data should be no column hightlight and new data should be highlighted.

i can able to sort the data but not able to sort and hightlight column based on id.

解决方案

Hi,

We can use REST API to sort by ID and use jQuery to highlight the newest data.

We need to add a "Script Editor" web part to insert our JavaScript code to the list page.

Here is a simple demo for your reference.

Below is my list.

Below is my code, the code will highlight the newest list item with red color.

<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
    var url = "http://sp/sites/DevSite/_api/web/lists/getbytitle('MyCustomList')/items?


orderby=ID desc"; var itemID; var interval;


(function () {


这篇关于如何突出显示共享点中的列表项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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