Table of Contents

JSON Views

Table of Contents

Add a custom JSON view

If none of our built-in JSON views suit your needs, and you have some JavaScript coding skills, you can upload your own custom JavaScript into a JS library in SharePoint, and have the Lightning Conductor refer to that. 

You may wish to start with one of our views, and just make some adjustments. The following example describes how to adjust the built-in calendar view to have the week begin on Monday instead of Sunday.

To modify the built-in Lightning Conductor calendar view, select it on the Display tab and then click the “eye” icon to view the JavaScript code.

Copy/paste the entire code into Notepad or similar.
Use Ctrl-F to find the section called calendarDiv.fullCalendar.
After the nextDayThreshold line, add the following line to set the first day of the monthly calendar to Monday instead of the default of Sunday (note it’s important to include the comma after the 1):
firstDay: 1,


So that section should look like this:

Save the file into some library on your SharePoint site, calling it something like MondayCalendar.js (the name can be whatever you want, but be sure the file extension is .js). Make sure this is a library that everyone who would be viewing the Lightning Conductor would have at least Read permission to.


In the Lightning Conductor, click on the JavaScript Files Library section at the bottom of the Display tab, and select the SharePoint library where you just saved your custom calendar js file. This is where the Lightning Conductor will look for any custom js files.

Click the Refresh button to refresh the dropdown of JavaScript files. You should now see your custom view to select it.

Because this is a custom file, you will now see a field called Rendering Function Name. Enter the name of the built-in function, which in this case is _LT_RenderLCAppDataInCalendar. This will cause the appropriate Rendering Code Settings to reappear.

Set the various calendar options (Rendering Code Settings) as you normally would, and click Save. Your calendar should now appear with Monday as the first day of the week.

NOTE: If you are creating a custom Grid View rather than a calendar view, then the Rendering Function Name should be _LT_RenderLCAppDataInGridView.

 

Was this article helpful?

Can’t find what you’re looking for?

Our world-class Customer Success team is here for you.

Contact Support