JavaScript dynamically changes the color of the sharepoint list

Source: Internet
Author: User

How to use JavaScript to dynamically change the display mode of each field in the list,

Requirement: The color settings of the List field are maintained through a list (ListFieldsColor). The list has the following fields:

You can manually set the foreground and background colors of the list fields.

Click the following link to familiarize yourself with Javascript API for sharepoint:

Http://darrenjohnstone.net/2008/07/22/examples-for-the-sharepoint-and-office-live-javascript-api/

 

Implementation Method: Use SPD to open the site to be set and introduce the script on the Default. master page,

It is declared that the following three js Files must first be placed in the C: \ Program Files \ Common Files \ Microsoft Shared \ web server extensions \ 12 \ TEMPLATE \ LAYOUTS Folder:

 

<Script type = "text/javascript" src = "../_ layouts/SPAPI/SPAPI_Core.js"> </script> // built-in Javascript API
<Script type = "text/javascript" src = "../_ layouts/SPAPI/SPAPI_Lists.js"> </script> // built-in Javascript API

<Script type = "text/javascript" src = "../_ layouts/SPAPI/NSAPI. js"> </script> // scripts written based on requirements and Javascript APIs

 

Script call method:

<Script type = "text/javascript">
NSPGVChangeColor ();
NFormChangeColor ();
</Script>

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.