I'm having troubles with a multidimensional array in javascript =>
I tried it with declaring several wayS. if i use this [[]] then only the [0]["title"] and [0]["start] are showed. I'm searching for hours without luck.
I want to put the result of this array in the fullcalendar script. I'm stuck.
function onLoadItemsSuccess(sender, args) {
var listInfo = '';
var listItemEnumerator = listItems.getEnumerator();
var item;
var listItemInfo = '';
var index = -1;
var datum = '';
var i2 = 0;
var verlofdagenarray = new Array();
//var verlofdagenarray = [[]];
while (listItemEnumerator.moveNext()) {
item = listItemEnumerator.get_current();
//alert("Item geeft nu het volgende weer" + item.toString());
//alert(listEnumerator.get_current().get_item("Title"));
var naam = item.get_item("Naam");
var telefoonnummer = item.get_item("Telefoonnr");
var mobiel = item.get_item("Mobielnr");
var voornaam = item.get_item("Voornaam");
var telefoonintern = item.get_item("TelefoonIntern");
var adres = item.get_item("Adres");
var postcode = item.get_item("Postcode");
var gemeente = item.get_item("Gemeente");
var land = item.get_item("Land");
var departement = item.get_item("Departement");
var functie = item.get_item("Functie");
var verlofdatum = item.get_item("Verlofdatum");
var emailadres = item.get_item("Emailadres");
var d = new Date(verlofdatum);
var curr_day = d.getDate();
var curr_month = ('0' + (d.getMonth() + 1)).slice(-2)
var curr_year = d.getFullYear();
var verlofdatum2 = curr_year + "-" + curr_month + "-" + curr_day;
verlofdagenarray = new Array(2);
verlofdagenarray[i2]["title"] = voornaam + "" + naam;
verlofdagenarray[i2]["start"] = verlofdatum2;
i2++;
}
document.write(verlofdagenarray[0]["title"]);
document.write(verlofdagenarray[0]["start"]);
$('#calendar').fullCalendar({
//eventSources: verlofdagenarray
// put your options and callbacks here
})
}