vinuthamsr
5 Jul 2012, 9:35 PM
Hello,
I am facing strange problem using this.store.load() function. The Json data is properly received from the server side as well as seen in the proxy->reader->jsondata
But the store is not able to save data here.
Please help in case there is problem with my code which I have attached below.
initComponent: function() {
Ext.apply(this, {
columns: [{
flex: 1,
sortable : true,
dataIndex: 'label',
renderer: this.formatTitle
},{
header : '',
width : 75,
sortable : true,
dataIndex: 'size',
align : 'right',
renderer : Ext.util.Format.numberRenderer('0,000')
}
],
store: Ext.create('KE.store.BrowseClasses', {
proxy : Ext.create('KE.proxy.BrowseClassesProxy', {})
})
});
this.callParent(arguments);
this.loadStore();
},
loadStore: function() {
this.store.load({
scope : this,
params: {
'time': new Date().getTime()
},
callback: function(records, operation, success) {
console.log(records);
//filterBy can only be called after load is successful
this.store.filterBy(function myfilter(record) {
console.log('iff');
//filter away values other than the following
if ( (record.get("localname") == "TechOffer") ||
(record.get("localname") == "TechAlertSubscriber") ||
(record.get("localname") == "BrochureDownloader") ||
(record.get("localname") == "Brochure") ||
(record.get("localname") == "Article") ||
(record.get("localname") == "Organization") ||
(record.get("localname") == "SystemDataSourceType")){
return true;
}
else
return false;
});
}
});
}
I am able to see the console.log(records) as an array containing 133 elements.
I am facing strange problem using this.store.load() function. The Json data is properly received from the server side as well as seen in the proxy->reader->jsondata
But the store is not able to save data here.
Please help in case there is problem with my code which I have attached below.
initComponent: function() {
Ext.apply(this, {
columns: [{
flex: 1,
sortable : true,
dataIndex: 'label',
renderer: this.formatTitle
},{
header : '',
width : 75,
sortable : true,
dataIndex: 'size',
align : 'right',
renderer : Ext.util.Format.numberRenderer('0,000')
}
],
store: Ext.create('KE.store.BrowseClasses', {
proxy : Ext.create('KE.proxy.BrowseClassesProxy', {})
})
});
this.callParent(arguments);
this.loadStore();
},
loadStore: function() {
this.store.load({
scope : this,
params: {
'time': new Date().getTime()
},
callback: function(records, operation, success) {
console.log(records);
//filterBy can only be called after load is successful
this.store.filterBy(function myfilter(record) {
console.log('iff');
//filter away values other than the following
if ( (record.get("localname") == "TechOffer") ||
(record.get("localname") == "TechAlertSubscriber") ||
(record.get("localname") == "BrochureDownloader") ||
(record.get("localname") == "Brochure") ||
(record.get("localname") == "Article") ||
(record.get("localname") == "Organization") ||
(record.get("localname") == "SystemDataSourceType")){
return true;
}
else
return false;
});
}
});
}
I am able to see the console.log(records) as an array containing 133 elements.