Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Update Grades and Ages in Family Info Card, this relies on additional info provided by cust_CCIW_get_family_data sproc
- var currentGUID = "";
- var currentRel;
- var currentAge, currentGrade;
- // Find all spans that contain the family info
- $("span[id$='FamilyInfo'] a").each(function(index) {
- // Grab the Guid
- //console.log(index + ": " + $(this).attr('rel').split(',')[1]);
- currentGUID = $(this).attr('rel').split(',')[1]
- //Fetch the age for the specified GUID from the cust_CCIW_get_family_data results
- //console.log('ID Selector:' + "#GUID"+currentGUID)
- //console.log('Current Hidden Input Based on Guid Selector:' + $("#GUID"+currentGUID))
- //console.log('Age Value:' + $("#GUID"+currentGUID).attr("age_value"))
- currentAge = $("#GUID" + currentGUID).attr("age_value")
- currentGrade = $("#GUID" + currentGUID).attr("grade")
- //currentRel = $("#GUID"+currentGUID);
- // Find the label that contains the household position, 3 parents up, next element, first child
- //console.log($(this).parent().parent().parent().next().children()[1].innerText)
- $(this).html($(this).html() + ' (' + currentAge + ')<br>');
- if (currentGrade != 13) {
- $(this).html($(this).html() + '<i class="fa nophoto mr-q fa-lg"></i>Grade: ' + currentGrade);
- }
- });
- //update the family member row for the profile you are currently visiting. The html structure slight differs.
- var currentPerson = $("span[id$='FamilyInfo'] > span > span")
- currentGUID = currentPerson.attr('rel').split(',')[1]
- currentAge = $("#GUID" + currentGUID).attr("age_value")
- currentGrade = $("#GUID" + currentGUID).attr("grade")
- currentPerson.html(currentPerson.html() + ' (' + currentAge + ')<br>');
- if (currentGrade != 13) {
- currentPerson.html(currentPerson.html() + '<i class="fa nophoto mr-q fa-lg"></i>Grade: ' + currentGrade);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement