Showing posts with label List View webpart. Show all posts
Showing posts with label List View webpart. Show all posts

Tuesday, March 10, 2015

How to replace status text with an image in the SharePoint listitem

If you have limited developer access to a SharePoint Team Site or no access to SharePoint Designer, this client-side workaround allows you to replace a set of standard text values with images in a list view. As an example, this script is useful for adding graphical representation of status indicators in a simple status dashboard.


Let’s assume we have a list named Environment with a column named Status which is lookup from another list on your site. The Status column can contain the following text values:
  • Active
  • InProgress
  • Complete
  • Cancelled
  • Scheduled
We have also uploaded a set of four corresponding images named green.png, yellow.png, red.png, amber.png and blue.png to an image library / site assets in the Team Site. When the list view is displayed for Environment, the text values for status column should be replaced with following corresponding images.
  • Active – green.png
  • Cancelled – yellow.png
  • Complete – red.png
  • InProgress – blue.png
  • Scheduled - amber.png
Add a Content Editor Web Part to the page containing list’s standard view and include the following script in the source. Once the page is loaded, the values displayed in the Status column are replaced with the appropriate image.
You can get the Jquery script from the following site - http://code.jquery.com/jquery-latest.min.js and store it in the site assets library of the Team site. 
You can place the below code in another Script.js file and store it in the site assets. 

Copy the path of the file in clipboard which looks something like this - http://<server-name>/sites/Support/SiteAssets/Script.js
Once the Script.js file has been created, you need to add content editor webpart on the list view webpart page. Edit the webpart and on the Toolpane properties in the Content Link, provide the url of the site assets where the file has been stored. Click on Apply and hit OK.

You will be able to see the change from text to image.

Note: As a warning, if the list view displays a large amount of data, then this script may cause a noticeable delay as it cycles through the HTML to perform the search and replace.

Tuesday, March 3, 2015

Summary and Detail Dashboards using the SharePoint OOTB webparts

In this post we will talk about creating a dashboard to display summary dashboard and on click of the item it displays the details dashboard in another page. We will achieve this by using the Out of the box (OOTB) web parts with no code.


  • Here we will create a Environment List which holds all the columns to be displayed in either summary dashboard or detailed dashboard. This will make loading of data into the list easier. 


  • Then we can create couple of views to display the data. We can create first view for Summary Dashboard to allow only few items to be displayed including the Title link. 





  • We can create a detailed view to hold all the columns values which are necessary to be shown.


  •  Create a Page for the Summary dashboard.
  • Add a List View webpart on the page.
  • Change the view of the webpart to Summary dashboard View.
  • Change the toolbar type to No Toolbar.
  • On click of the Title link it will redirect to displayform.aspx page.
  • In the Displayform.aspx page, edit the page and minimize the existing display webpart.
  • Add a List view webpart on the Dsiplay page.
  • Add a Query String (URL) Filter webpart on the display page.
  • Go to the webpart settings of the List View webpart, select the Details View to show all the columns being selected in this view. 
  • Change the toolbar type to No Toolbar.
  • Edit the Query String filter webpart and in the Query String Parameter name, provide the value "ID".
  • In the advanced filter options, select Send all values.
  • Use the Connections to send data from the Query String webpart and Get filter values from the List View webpart.
This makes the dashboard to work seamlessly without need of any codes. Enjoy...!!!