javascript - FullCalendar events do not hold color change -


i changing events in fullcalendar (http://arshaw.com/fullcalendar/docs/event_data/) doing following:

            eventclick: function (event)             {                 if ($(this).css('background-color').match(/^(?:green|#fff(?:fff)?|rgba?\(\s*0\s*,\s*255\s*,\s*0\s*(?:,\s*1\s*)?\))$/i)) {                     $(this).css('border-color', 'red');                     $(this).css('backgroundcolor', 'red');                 }                 else if ($(this).css('background-color').match(/^(?:red|#fff(?:fff)?|rgba?\(\s*255\s*,\s*0\s*,\s*0\s*(?:,\s*1\s*)?\))$/i)) {                     $(this).css('border-color', 'blue');                     $(this).css('backgroundcolor', 'blue');                 }             } 

but find once change event color (or several event colors) , drag event day, events change color original colours.

how can prevent this??? how can make evet persist color once changed?

use this:

eventclick: function (event)             {                 if ($(this).css('background-color').match(/^(?:green|#fff(?:fff)?|rgba?\(\s*0\s*,\s*255\s*,\s*0\s*(?:,\s*1\s*)?\))$/i)) {                     event.color = 'red';                     event.bordercolor = 'red';                 }                 else if ($(this).css('background-color').match(/^(?:red|#fff(?:fff)?|rgba?\(\s*255\s*,\s*0\s*,\s*0\s*(?:,\s*1\s*)?\))$/i)) {                     event.color = 'blue';                     event.bordercolor = 'blue';                 }                 calendar.fullcalendar('renderevent',event ,true);             } 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -