themouette/jquery-week-calendar — Issue #117: switchDisplay bug with multiples instances
Author: gildonei
Created: 2012-01-23 14:10:42+00:00
State: open

I'm using the version 2.0-dev and when I create 2 instances of the calendar with the same configuration, but displaying diferent data, the buttons on switch display doesn't work properly.

The actions on the buttons are always trigged on the first rendered calendar.

I've observed that when I've the same labels on diferent calendars, they've the same "Ids" causing the crash.

I solved this problem modifying the following lines:

716: var _randId = Math.random(99999).toString().substr(2,7); (added)
717: var _id = 'wc-switch-display-' + option + '-' + _randId; (modified)

I hope it can be usefull.