Abstract
In this example, leadership wanted to have information about network alerts on our main SharePoint home page. At the Air Force Academy, we have two different networks (educational and military). Each alert would be characterized by order of importance as Outage, HAZCON, or Informational. My design was to have an Announcements list with unique permissions so that only the group that was allowed to add alerts could edit it. Everyone would have read access. I would customize the display using jQuery so that outages would be more prominent.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
This is important. In my first release of this functionality, I had locked the list down so much that only myself and my initial testers could read the list. When my squadron director looked at it, he got an error message. I first thought there was a problem with the JavaScript but I eventually realized it was a permissions problem.
- 2.
Using [Today] in SharePoint filters is a powerful feature that I use often.
- 3.
Notice how the use of contains allows us to pick up items where the Affected Network is EDU as well as the ones where it is both EDU and MIL.
- 4.
This is rare good news when using jQuery with SharePoint. As you may notice in other examples, we typically have to use classes and loop through them because the generated HTML does not often have ids. We are not totally out of the woods since it is possible for both lists to have empty elements, which then results in one row having a different id. But testing revealed that the id always started with empty-WPQ. Listing 7 shows actual jQuery logic.
- 5.
As we have seen earlier, the shorthand for this is the $(function () {} syntax.
- 6.
The . means class.
- 7.
We use the pipes to avoid the possibility that other text on the page might match our code. 1. Outage is possible on the rest of the page. |||1. Outage||| is not very likely to occur in other text.
- 8.
Notice how we use the substring function to get rid of the numbers at the front. So className will be a value like AlertOutage.
- 9.
The ∗ means contains in jQuery.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Jeffrey M. Rhodes
About this chapter
Cite this chapter
Rhodes, J.M. (2019). Customizing an Announcement List with jQuery. In: Creating Business Applications with Office 365. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-5331-1_5
Download citation
DOI: https://doi.org/10.1007/978-1-4842-5331-1_5
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-5330-4
Online ISBN: 978-1-4842-5331-1
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)