I use an ajax call to populate dataSource from MySQL and my customDataSourceRenderer doesn't work.
if i hardcode the dataSource var, everything works as it should. Can anyone help me please?
The problem was my date format. For some reason it wasn't passing the correct date and customDataSourceRenderer didn't pick the correct date to highlight.
The way i solved it was to checking every entry for the customDataSourceRenderer and figured out it was my date.
////////////////////-SOLUTION-////////////////////////////////////////////////////
var dataSource = [];
$.ajax({
url: '/getallevents',
async: false,
dataType: 'json',
success: function (response) {
var dataSource= [];
for (var i = 0; i < response.length; i++) {
var startdate = response[i].startDate.split("-");
var enddate = response[i].endDate.split("-");
dataSource.push({
id: response[i].id,
name: response[i].name,
location: response[i].location,
startDate: new Date(startdate[0],startdate[1],startdate[2]),
endDate: new Date(enddate[0],enddate[1],enddate[2]),
type: response[i].type
});
I use an ajax call to populate dataSource from MySQL and my customDataSourceRenderer doesn't work. if i hardcode the dataSource var, everything works as it should. Can anyone help me please?
customDataSourceRenderer: --->
AJAX: -->
/////////////////////////////////////////////////////// [SOLVED] //////////////////////////////////////////////////////
The problem was my date format. For some reason it wasn't passing the correct date and customDataSourceRenderer didn't pick the correct date to highlight. The way i solved it was to checking every entry for the customDataSourceRenderer and figured out it was my date. ////////////////////-SOLUTION-////////////////////////////////////////////////////