PDA

View Full Version : extjs calendar with dynamic data loading



javapurna
11 Oct 2013, 9:23 PM
Hi every one,

i am using extjs 4.2 gpl (examples ->calendar)calendar (http://dev.sencha.com/deploy/ext-4.1.0-gpl/examples/calendar/). i am try to load data from database ,in my application i am using Deftjs to inject store(MemoryEventStore). the data to be loaded into store ,but data not show in calendar views.
view pages show no events.
how to load dynamic data into store .
please help me .

existdissolve
12 Oct 2013, 3:40 AM
Can you please post your code? Without seeing your code, it's difficult to know where to begin in helping to debug your issue.

Thanks!

javapurna
14 Oct 2013, 10:40 PM
thanks very much for replaying existdissolve (http://www.sencha.com/forum/member.php?105411-existdissolve) . it working fine after i am loading data like below in Memoryevent.js--->onProxyLoad

onProxyLoad: function(operation) {
var me = this,
records;
console.log(" =====> me.data.length :: "+me.data.length);
if (me.data && me.data.length > 0) {
// this store has already been initially loaded, so do not reload
// and lose updates to the store, just use store's latest data
me.totalCount = me.data.length;
console.log( me.data.items);
records = me.data.items;
console.log(records);
console.log(" =====>records");
records[0].data['CalendarId']=1;
records[0].data['EventId']=1;
records[0].data['IsAllDay']=false;
records[0].data['IsNew']=true;
records[0].data['Title']="cxzcxcccxvc";
records[0].data['StartDate']=new Date();
records[0].data['EndDate']=new Date();
records[0].data['Reminder']="";
records[0].data['Url']="";
records[0].data['Location']="";
me.loadRecords(records, operation);
}
else {
// this is the initial load, so defer to the proxy's result
var resultSet = operation.getResultSet(),
successful = operation.wasSuccessful();
console.log(" =====> successful :: "+successful);
records = operation.getRecords();


if (resultSet) {
me.totalCount = resultSet.total;
}
if (successful) {
console.log(" =====> records ::successful ");
console.log(records);
var today= new Date();
var tomarrow=new Date()
console.dir(today);
for(var i=0;i<resultSet.total;i++){
records[i].data.StartDate=today;
records[i].data.EndDate=tomarrow.setDate(tomarrow.getDate()+1);
}
me.loadRecords(records, operation);
}
}
console.log(" =====> :: ");

me.loading = false;

console.log(" =====> records :: "+records);
console.dir(records);
console.log(" =====> successful :: "+successful);

me.fireEvent('load', me, records, successful);
}

nMehmood
3 Mar 2015, 12:45 AM
Were you able to sort out this issue? I am having same issue with Ext 5 calendar control if you can please help me on this one here.

Thanks