jquery-week-calendar icon indicating copy to clipboard operation
jquery-week-calendar copied to clipboard

Set readonly flag based on data

Open chimericdream opened this issue 15 years ago • 2 comments

I have a working implementation of the calendar pulling from several different data sets. However, I need to be able to set the readonly flag based on which data set is being displayed. Currently the calendar is either completely read only, completely writable, or individual events can be read only.

Anyone get this feature working? I've spent the past 8 hours at work trying to do only this.

Thanks in advance.

chimericdream avatar Feb 05 '10 22:02 chimericdream

It is a very good idea and I would be interested also.

Maraumax avatar Feb 17 '10 09:02 Maraumax

I don't know if you're still having a problem with this, but I've found it useful, when combining datasets, to add a field into the data regarding what dataset is being polled.

for example you can add properties to the event on your server

{"id":1, "start":"2009-05-10T13:15:00.000+10:00", "end":"2009-05-10T14:15:00.000+10:00", "title":"Lunch with Mike", "dataset":"thereadonlyone", "will_there_be_snacks?":"totally"}


these properties can be used to set up the readonly value as part of the 'eventrender' function:

    eventRender : function(calEvent, $event) {
        if(calEvent.dataset == "thereadonlyone"){
                                  calEvent.readOnly = true;
        };
        if(calEvent["will_there_be_snacks?"] == "totally"){
                                  $event.addClass("there_will_be_snacks")
        };

    },

graemeworthy avatar Jun 02 '10 22:06 graemeworthy