I’m trying to retrieve the data from a selected event. It works fine in preview and on android, but on ios this is what happens:
- click event one, displays correct jobid
- click event two, displays jobid for event one
- click event two, displays correct jobid
I’m building a cordova mobile app with monaca/onsen ui.
$(function () {
var now = new Date(),
calendar = $('#mobiscroll').mobiscroll().eventcalendar({
display: 'inline',
view: {
calendar: { type: 'week' },
eventList: { type: 'day', scrollable: true }
},
onPageLoading: function (event, inst) {
var year = event.firstDay.getFullYear(),
month = event.firstDay.getMonth();
mobiscroll.util.getJson('http://x.x.x.x:8888/mobile/service?ac=getAllJobsMobi&cpaID=34&year=' + year + '&month=' + (month + 1), function (data) {
var events = [];
for (var i = 0; i < data.length; i++) {
events.push({
start: data[i].start,
end: data[i].end,
d: data[i].d,
text: data[i].text,
color: data[i].color,
jobid: data[i].jobid
});
}
inst.setEvents(events);
}, 'json');
},
onEventSelect: function (event, inst) {
alert(event.event.jobid);
}
}).mobiscroll('getInst');
…