I just updated my aplication from ext js 4.1 (Build Date 2012-07-04- 21:23:42) to extjs 4.2.1.883, but my gridpanels are rendering very slow, it took almost 30 seconds in rendering for each request. This is my code of my store:
Ext.define('App.store.Item', {
extend: 'Ext.data.Store',
requires: [
'App.model.Item'],
constructor: function(cfg) {
});
With the previous extjs(4.1) it works normally. Now I realizes it is because I am doing some operation on load event to fix the format of date fields. But now I want it to work with the last version of extjs, How can I fix it? Any helps please.
Ext.define('App.store.Item', {
extend: 'Ext.data.Store',
requires: [
'App.model.Item'],
constructor: function(cfg) {
var me = this;
cfg = cfg || {};
me.callParent([Ext.apply({
model: 'App.model.Item',
remoteFilter: true,
remoteSort: true,
pageSize: 50,
cfg = cfg || {};
me.callParent([Ext.apply({
model: 'App.model.Item',
remoteFilter: true,
remoteSort: true,
pageSize: 50,
proxy: {
type: 'ajax',
url: '/Item/GetItems',
reader: {
type: 'json',
messageProperty: 'success',
root: 'result',
totalProperty: 'totalCount'
}
type: 'ajax',
url: '/Item/GetItems',
reader: {
type: 'json',
messageProperty: 'success',
root: 'result',
totalProperty: 'totalCount'
}
},
listeners: {
listeners: {
'load': function(store, records, options) {
if (records) records.forEach(function(record) {
record.set('CreatedDate', Utils.parseJsonDateToDate(record.data.CreatedDate));
record.set('ModifiedDate', Utils.parseJsonDateToDate(record.data.ModifiedDate));
record.set('StartDate', Utils.parseJsonDateToDate(record.data.StartDate));
record.commit();
if (records) records.forEach(function(record) {
record.set('CreatedDate', Utils.parseJsonDateToDate(record.data.CreatedDate));
record.set('ModifiedDate', Utils.parseJsonDateToDate(record.data.ModifiedDate));
record.set('StartDate', Utils.parseJsonDateToDate(record.data.StartDate));
record.commit();
});
}
}
}, cfg)]);
}
}
}
}, cfg)]);
}
});
With the previous extjs(4.1) it works normally. Now I realizes it is because I am doing some operation on load event to fix the format of date fields. But now I want it to work with the last version of extjs, How can I fix it? Any helps please.
Aucun commentaire:
Enregistrer un commentaire