Go to the list or library that you want to resize and add a Content Editor Web Part.
From the script below, I am referencing jQuery from my internal site.
Copy and paste this code into the CEWP.
$(“TH.ms-vh2-nograd:contains(‘Column 2’)”).css(“width”, “350px”);
“Column 1” and “Column 2” will be the name or your columns that you want to resize.
Here is an example I used and only resized one column:
Follow these steps and your will be highlighting in no time!!!
- Go to your list to be highlighted
- Edit Page
- Add a Content Editor Web Part
- Move the CEWP to the bottom of the page
- Click the Edit Source button
- Copy and paste the following lines of code into the source code section
if (x[i].innerHTML==”Next Day Pickup”) //find the data to use to determine the color
x[i].parentNode.style.backgroundColor=’yellow’; // set the color
- Make your changes to the innerHTML section to reflect the list value for the jquery lookup
- Set the color of your choosing. You can also choose to use the html value for the color: FFFFOO
Please note, I am referencing jquery inside of my SharePoint site. This way, I do not have to add an external reference.
There may come a time when you may need to export your user list to excel. It’s not that difficult.
- Copy the following path into notepad/word pad: http://yoursite.com/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=[LISTID]&View=[VIEWID]&CacheControl
- Minimize the text editor and navigate to Site Actions à Site Setting à People and Groups à All People.
- Click Settings on the option bar and click List Settings
- Click on “List View” under views. This will take you to the “Edit View” screen
- Copy the url of the list view. It will look similar to the following:http://yoursite.com/_layouts/ViewEdit.aspx?List=%7B02ACF6F6%2D8343%2D4244%2D81B8%2D68BF95F9C6D0%7D&View=%7B56BB9BDD%2DABB0%2D4CB6%2DA946%2D59A85A8EC2F9%7D&Source=%252F%255Flayouts%252Flistedit%252Easpx%253FList%253D02acf6f6%252D8343%2
- Copy the “List” and “View” IDs for the url that was created in step 5. You list id will follow “List=”. The same applies for the view id. Here is the example from above: List=%7B02ACF6F6%2D8343%2D4244%2D81B8%2D68BF95F9C6D0%7D&View=%7B56BB9BDD%2DABB0%2D4CB6%2DA946%2D59A85A8EC2F9%7D
- From this example, copy %7B02ACF6F6%2D8343%2D4244%2D81B8%2D68BF95F9C6D0%7D and replace [LISTID] from step one. This includes replacing the LISTID and the brackets. Also, do not include the & symbol. Follow the same steps for the “View”.
- Once you have finished, your completed url should look like this:http://yoursite.com/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List=%7B02ACF6F6%2D8343%2D4244%2D81B8%2D68BF95F9C6D0%7D&View=%7B56BB9BDD%2DABB0%2D4CB6%2DA946%2D59A85A8EC2F9%7D&CacheControl
- Open a browser, and copy and paste the completed url that you completed in step 8.
- A window will pop up asking you to open or save the file. Click open and the file will open in excel.
- A security warning will also pop up. Click enable.
12. After you are finished making your changes, you can save this like any other Excel file.
When a user that is restricted from a specific list visits the site; the view of that list displays an access denied message rather than hiding the Web Part from the user. It appears that the security for the list is evaluated prior to the Web Part evaluating the targeted audiences. Since the user does not have access to the list, the access denied message is shown as a result.
We can remedy this issue by granting the lowest privilege on the list for the user. As a requirement, the user must not be able to view any list items, so we will give the user the ability to see the list, but not the ability to see any items in the list. This is accomplished by creating a custom permission level that will contain ONLY the Open permission from the Site permissions group. This will allow users possesing this permission to open the list, but will not grant them the permission to open any items in the list. Grant the newly created permission level to the restricted users on the list and the audience targeting on the list views will now function as intended.