I have got a question which involves loading a json string which was returned from my PHP Class.
I have the json string and I tried performing scheduler.parse( [
{start_date:"2011-12-01 09:00",end_date:"2011-01-12 10:00",text:"test"}
], 'json' );
I have also tried: scheduler.load( [
{start_date:"2011-12-01 09:00",end_date:"2011-01-12 10:00",text:"test"}
], 'json' );
However, I cannot seem to get any of it working. What am I doing wrong?
By the way I am running this within the init() function.
That worked a charm, but if I am retrieving data back from an AJAX request how would I pass the load() or parse() function the responseText (which would be a json encoded string).
Any ideas?
[code] function init() {
scheduler.config.multi_day = true;
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.init('scheduler_here',new Date(2011,0,1),"month");
if( window.XMLHttpRequest ){
var xmlHttp = new XMLHttpRequest();
} else {
var xmlHttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
}
xmlHttp.open('POST', 'test.php', false);
xmlHttp.send();
var data = xmlHttp.responseText ;
console.log( data );
scheduler.load()
scheduler.parse( data, 'json' );
}
[/code]