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>