Quantcast
Channel: jQuery Library for SharePoint Web Services
Viewing all articles
Browse latest Browse all 6517

New Post: Pretty new to jQuery trying to do something (hopefully) simple with SPServices

$
0
0
Hey guys, so I'm pretty new at jQuery and I'm trying to write a script that does:
  • Gets list items (calendar)
  • Gets and saves in a var the items' 'Title' and whether a checkbox is checked or not
  • If checkbox.checked > parse a div on another page for a title match.
  • If the title is matched > CSS override to turn the text in that div red.
Hopefully that was a clear explanation. Essentially, I've got a web part on the front page that displays come calendar events (among other things) from a calendar elsewhere in SP. I want to add an "alert" function (a checkbox column in the calendar) so that when the checkbox is checked for that calendar event, it turns the text for that event red in the front page web part. I'm set on doing this externally (CEWP instead of altering the actual web part, which I don't have access to). Hopefully this is possible to do...Here's what I've got using spservices to get the list items:
$(document).ready(function () {
$().SPServices({
    operation: "GetListItems",
    async: false,
    listName: "calendar",
    webURL: "http://myintranet/calendar.aspx",
    CAMLViewFields: "<ViewFields><FieldRef Name='Checkbox' /><FieldRef Name='Title' /></ViewFields>",
    })

// If checkbox is checked -- save the title of the calendar event in a variable
// Search the front page inside the div that displays the calendar events for a match to that title

$(".divThatContainsTheCalendarEvents('VariableThatHoldsTheTitleOfTheEvent')").css("color", "red");
});
Pretty much stuck here. I know what I want to do, but not really how to do it.

Viewing all articles
Browse latest Browse all 6517

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>