[FullCalendar 2] Sample EventDataJSON??

[FullCalendar 2] Sample EventDataJSON??

  
Forge Component
(14)
Published on 2016-03-23 by Grazina
14 votes
Published on 2016-03-23 by Grazina

I am new to FullCalendar2 - I have a DB table filled with "tasks" with due dates and want to show them to the user in a nice monthly calendar view.I am struggling with what seems like easy JSON built from an aggregate in the page Preperation.

Is there a sample of exactly the correct format that the FullCalendarWebBlock parameter "EventDataJSON"?

The calendar simply does not appear when I pass in my sample JSON. When I let EventDataJSON be null/default then the calendar appears but obviously with no events in the calendar.

Here is a sample of the JSON I am trying

SyntaxEditor Code Snippet

TRY #1
===========================
{
    start: '2017-09-11',
    end: '2017-09-12',
    title: 'Never Forget',
    color: 'red',
    textColor: 'white'
}

TRY #2
===========================
[
  {
    start: '2017-09-11',
    end: '2017-09-12',
    title: 'Never Forget',
    color: 'red',
    textColor: 'white'
  }
]

Thank you!!!

Hello Bruce,

The EventDataJSON attribute is to input configurations regarding the Data to be inputted.

What you want to use is the "EventsJSON". 

I ran a test using the following "Text" on the EventsJSON attribute and was able to get an event in the calendar:


"[
   {
      ""id"":""1"",
      ""resourceId"":"""",
      ""title"":""test1"",
      ""allDay"":false,
      ""start"":""2018-01-04T00:00:00Z"",
      ""end"":""2018-01-04T00:00:00Z"",
      ""url"":"""",
      ""className"":"""",
      ""editable"":false,
      ""startEditable"":false,
      ""durationEditable"":false,
      ""rendering"":"""",
      ""overlap"":false,
      ""constraint"":"""",
      ""source"":"""",
      ""color"":"""",
      ""backgroundColor"":"""",
      ""borderColor"":"""",
      ""textColor"":"""",
      ""description"":""""
   }
]"


Hope it helps

Miguel Amado

SyntaxEditor Code Snippet

SyntaxEditor Code Snippet

EventsJSON="[ "

SyntaxEditor Code Snippet

Elemento For...
EventsJSON=EventsJSON+   "{
      ""id"":""1"",
      ""resourceId"":"""",
      ""title"":"" "+GetEventoCalendarios.List.Current.TipoEvento.Label+" "",
      ""allDay"":false,
      ""start"":"" "+GetEventoCalendarios.List.Current.EventoCalendario.DataInicial+" "",
      ""end"":"" "+GetEventoCalendarios.List.Current.EventoCalendario.DataFinal+" "",
      ""url"":"""",
      ""className"":"""",
      ""editable"":false,
      ""startEditable"":false,
      ""durationEditable"":false,
      ""rendering"":"""",
      ""overlap"":false,
      ""constraint"":"""",
      ""source"":"""",
      ""color"":"" "+GetEventoCalendarios.List.Current.TipoEvento.Cor+" "",
      ""backgroundColor"":"" "+GetEventoCalendarios.List.Current.TipoEvento.Cor+" "",
      ""borderColor"":"""",
      ""textColor"":"""",
      ""description"":"" "+GetEventoCalendarios.List.Current.TipoEvento.Label+" ""
   },"

SyntaxEditor Code Snippet

EventsJSON=EventsJSON+"]"