fullcalendar data from json object











up vote
0
down vote

favorite












I load json from a php file but the json contains other data. The events are placed in the 'fullcalendar' object but i do not know how i can select the data.



I load current the data with this code, can someone point me in the right direction?



Greathings Christophe VD



    $('#Agenda').fullCalendar({
lang: 'nl',
height: "parent",
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: {
url: json_url,
type: 'POST',
data: {
actie: "GetList"
},
success: function(data) {
return data.fullCalendar;
},
error: function(data) {
alert('Systeemfout.');
}
},
eventClick: function(calEvent, jsEvent, view) {
var huur_id = calEvent.id;
weergave(huur_id);
},
dayClick: function(date, jsEvent, view) {
var label = date.format("d-MM-YYYY");
}
})









share|improve this question


















  • 1




    Didn't understand your requirement. Could you please elaborate more
    – front_end_dev
    Nov 10 at 17:38










  • if you're not directly returning events in the format required by fullCalendar then you'll need to use this syntax for declaring the "events" property instead. Then you use the provided callback function to return the relevant data to fullCalendar. Alternatively, if you want to stick with the current JavaScript code, make your server just return a flat array of events, instead of an object which then contains an array in a sub-property. Then fullCalendar will detect it automatically and you can remove your "success" callback entirely.
    – ADyson
    Nov 10 at 20:03










  • @ADyson, Thanks that did the job. i had try it but it was a white background with white text color so it was empty.
    – user3142817
    Nov 10 at 23:09















up vote
0
down vote

favorite












I load json from a php file but the json contains other data. The events are placed in the 'fullcalendar' object but i do not know how i can select the data.



I load current the data with this code, can someone point me in the right direction?



Greathings Christophe VD



    $('#Agenda').fullCalendar({
lang: 'nl',
height: "parent",
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: {
url: json_url,
type: 'POST',
data: {
actie: "GetList"
},
success: function(data) {
return data.fullCalendar;
},
error: function(data) {
alert('Systeemfout.');
}
},
eventClick: function(calEvent, jsEvent, view) {
var huur_id = calEvent.id;
weergave(huur_id);
},
dayClick: function(date, jsEvent, view) {
var label = date.format("d-MM-YYYY");
}
})









share|improve this question


















  • 1




    Didn't understand your requirement. Could you please elaborate more
    – front_end_dev
    Nov 10 at 17:38










  • if you're not directly returning events in the format required by fullCalendar then you'll need to use this syntax for declaring the "events" property instead. Then you use the provided callback function to return the relevant data to fullCalendar. Alternatively, if you want to stick with the current JavaScript code, make your server just return a flat array of events, instead of an object which then contains an array in a sub-property. Then fullCalendar will detect it automatically and you can remove your "success" callback entirely.
    – ADyson
    Nov 10 at 20:03










  • @ADyson, Thanks that did the job. i had try it but it was a white background with white text color so it was empty.
    – user3142817
    Nov 10 at 23:09













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I load json from a php file but the json contains other data. The events are placed in the 'fullcalendar' object but i do not know how i can select the data.



I load current the data with this code, can someone point me in the right direction?



Greathings Christophe VD



    $('#Agenda').fullCalendar({
lang: 'nl',
height: "parent",
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: {
url: json_url,
type: 'POST',
data: {
actie: "GetList"
},
success: function(data) {
return data.fullCalendar;
},
error: function(data) {
alert('Systeemfout.');
}
},
eventClick: function(calEvent, jsEvent, view) {
var huur_id = calEvent.id;
weergave(huur_id);
},
dayClick: function(date, jsEvent, view) {
var label = date.format("d-MM-YYYY");
}
})









share|improve this question













I load json from a php file but the json contains other data. The events are placed in the 'fullcalendar' object but i do not know how i can select the data.



I load current the data with this code, can someone point me in the right direction?



Greathings Christophe VD



    $('#Agenda').fullCalendar({
lang: 'nl',
height: "parent",
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
events: {
url: json_url,
type: 'POST',
data: {
actie: "GetList"
},
success: function(data) {
return data.fullCalendar;
},
error: function(data) {
alert('Systeemfout.');
}
},
eventClick: function(calEvent, jsEvent, view) {
var huur_id = calEvent.id;
weergave(huur_id);
},
dayClick: function(date, jsEvent, view) {
var label = date.format("d-MM-YYYY");
}
})






javascript json fullcalendar






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 17:30









user3142817

4312614




4312614








  • 1




    Didn't understand your requirement. Could you please elaborate more
    – front_end_dev
    Nov 10 at 17:38










  • if you're not directly returning events in the format required by fullCalendar then you'll need to use this syntax for declaring the "events" property instead. Then you use the provided callback function to return the relevant data to fullCalendar. Alternatively, if you want to stick with the current JavaScript code, make your server just return a flat array of events, instead of an object which then contains an array in a sub-property. Then fullCalendar will detect it automatically and you can remove your "success" callback entirely.
    – ADyson
    Nov 10 at 20:03










  • @ADyson, Thanks that did the job. i had try it but it was a white background with white text color so it was empty.
    – user3142817
    Nov 10 at 23:09














  • 1




    Didn't understand your requirement. Could you please elaborate more
    – front_end_dev
    Nov 10 at 17:38










  • if you're not directly returning events in the format required by fullCalendar then you'll need to use this syntax for declaring the "events" property instead. Then you use the provided callback function to return the relevant data to fullCalendar. Alternatively, if you want to stick with the current JavaScript code, make your server just return a flat array of events, instead of an object which then contains an array in a sub-property. Then fullCalendar will detect it automatically and you can remove your "success" callback entirely.
    – ADyson
    Nov 10 at 20:03










  • @ADyson, Thanks that did the job. i had try it but it was a white background with white text color so it was empty.
    – user3142817
    Nov 10 at 23:09








1




1




Didn't understand your requirement. Could you please elaborate more
– front_end_dev
Nov 10 at 17:38




Didn't understand your requirement. Could you please elaborate more
– front_end_dev
Nov 10 at 17:38












if you're not directly returning events in the format required by fullCalendar then you'll need to use this syntax for declaring the "events" property instead. Then you use the provided callback function to return the relevant data to fullCalendar. Alternatively, if you want to stick with the current JavaScript code, make your server just return a flat array of events, instead of an object which then contains an array in a sub-property. Then fullCalendar will detect it automatically and you can remove your "success" callback entirely.
– ADyson
Nov 10 at 20:03




if you're not directly returning events in the format required by fullCalendar then you'll need to use this syntax for declaring the "events" property instead. Then you use the provided callback function to return the relevant data to fullCalendar. Alternatively, if you want to stick with the current JavaScript code, make your server just return a flat array of events, instead of an object which then contains an array in a sub-property. Then fullCalendar will detect it automatically and you can remove your "success" callback entirely.
– ADyson
Nov 10 at 20:03












@ADyson, Thanks that did the job. i had try it but it was a white background with white text color so it was empty.
– user3142817
Nov 10 at 23:09




@ADyson, Thanks that did the job. i had try it but it was a white background with white text color so it was empty.
– user3142817
Nov 10 at 23:09

















active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241588%2ffullcalendar-data-from-json-object%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53241588%2ffullcalendar-data-from-json-object%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

List item for chat from Array inside array React Native

Thiostrepton

Caerphilly