I tried to modify model definition for working on my server api, and then setting the idProperty for unique event id as like below
Ext.define('MomPapa.model.Program', {
extend: 'Ext.data.Model',
config: {
idProperty: 'progress_idx',
fields: [{
name: 'progress_idx',
type: 'int'
}, {
name: 'event',
type: 'string'
}, {
name: 'title',
type: 'string'
}, {
name: 'start',
type: 'date',
dateFormat: 'c'
}, {
name: 'end',
type: 'date',
dateFormat: 'c'
}, {
name: 'css',
type: 'string'
}]
}
});
and then... the eventtap handler get the undefined eventRecord, because searching record failed... I eventually found the code that make error.
in the below code, you try to find the record by comparing internalId and eventID with === operator. However, in this case, internalId is string and eventId is number, so always this searching cannot find anything...
/*
* Get the Event record with the specified eventID (eventID equates to a record's internalId)
* @method
* @private
* @param {Object} eventID
/
getEventRecord: function(eventID){
var eventRecordIndex = this.calendar.eventStore.findBy(function(rec){
return rec.internalId === eventID;
}, this);
return this.calendar.eventStore.getAt(eventRecordIndex);
},
I tried to modify model definition for working on my server api, and then setting the idProperty for unique event id as like below
Ext.define('MomPapa.model.Program', { extend: 'Ext.data.Model', config: { idProperty: 'progress_idx', fields: [{ name: 'progress_idx', type: 'int' }, { name: 'event', type: 'string' }, { name: 'title', type: 'string' }, { name: 'start', type: 'date', dateFormat: 'c' }, { name: 'end', type: 'date', dateFormat: 'c' }, { name: 'css', type: 'string' }] } });
and then... the eventtap handler get the undefined eventRecord, because searching record failed... I eventually found the code that make error. in the below code, you try to find the record by comparing internalId and eventID with === operator. However, in this case, internalId is string and eventId is number, so always this searching cannot find anything...
/* * Get the Event record with the specified eventID (eventID equates to a record's internalId) * @method * @private * @param {Object} eventID / getEventRecord: function(eventID){ var eventRecordIndex = this.calendar.eventStore.findBy(function(rec){ return rec.internalId === eventID; }, this); return this.calendar.eventStore.getAt(eventRecordIndex); },
Please check this issue..