Home › Forums › Welcome! › Pre-Sales Questions › run javascript on NEXT MONTH
- This topic has 4 replies, 2 voices, and was last updated 12 years, 2 months ago by Rob.
-
AuthorPosts
-
February 17, 2012 at 6:40 am #15312EricParticipant
My calendar is at this URL: http://www.rackandhelens.com/rack/calendar/
WHen I go to the next month, you will see the table zebra striping go away.
I have a javascript function to add the class, but I need to run it when the new month is loaded.
Any ideas?
February 17, 2012 at 7:40 am #15315RobMemberHey Eric. Slick looking site. I’m happy to try and help you out here, but I am unable to see the issue here…best I can tell the calendar looks the same whether I’m at the current month or one in the future. Have I misunderstood the request here?
February 17, 2012 at 11:09 am #15333EricParticipantRob –
Thanks for helping out. I’ve restored it to the “BROKEN” condition.
Here’s what I am doing:
1. When the page loads, I use jquery to addClass to the ODD and EVEN rows (creating the zebra stripe).
The problem as best I can figure it is that when a new table is loaded, it comes in via AJAX so the document.ready handler is NOT refired. I have a javascript function called doStripe() that will do the trick, but don’t know how to call it.
To fix the problem, I went into /lib/events.js and commented out the PJAX lines around line 59 – this forced the page to do a true reload instead of an ajax call. This fixed the problem, but I’d like the ajax load if possible.
Thanks for the comments about the site. It is coming along nicely. We have a TON of custom data types handling a lot of the data stuff.
February 17, 2012 at 1:24 pm #15340EricParticipantI had to recomment out the lines. We needed the site live for the weekend (it’s a restaurant…).
And, the file I’m messing around with is /resources/events.js not /lib/events.js just FYI.
Also, I need to chagne the top half background picture as well. So, for now this works good.
But, I need some kind of call back function after the pjax loading…
Thanks.
February 17, 2012 at 7:10 pm #15349RobMemberHey Eric. Thanks for the follow-up here; glad to see you found a workaround of sorts here. This issue of the callback function is a bit outside my area of expertise, but let me see if one of our devs has an idea when they hit the forums next.
-
AuthorPosts
- The topic ‘run javascript on NEXT MONTH’ is closed to new replies.