Set invalid dates using remote/dynamic data


I’m using remote data through an external request, using the setEvents method to set the events.

But, I need also to set the invalid dates dynamically or using alson remote data. How can I achieve this?


Hi there,

You can use the setOptions method for that:

    invalid: [...]

Thanks Gabi, but I mean, dynamically, querying a database, as I set events per user basis like this:

mobiscroll.util.http.getJson(’/data/calendario.php?user_id=’+id, function (events) {
}, ‘json’);

And each user has it’s own invalid dates.

Hi Chorch, this usage is applicable inside the json request as well.

Thanks, but, how?

I couln’t find any info in the docs about how to format the json or set the invalid dates received…

Hi @Chorch

Can you provide some more details on what are you having trouble with exactly?
To set the invalids to the eventcalendar you have to call the setOptions method the same way you call the setEvents:

  invalid: myInvalids

In the above example myInvalids has to be the array of the invalids.