Greetings, I am trying to modify a system that is already done in ExtJS and my problem is when I get data from a store that is as follows:
Ext.define('sistema.store.ProductionPeriodClosureAll', {
extend: 'Ext.data.Store',
model: 'sistema.model.ProductionPeriodClosureModel',
require: [
'Ext.data.Store',
'sistema.model.ProductionPeriodClosureModel'
],
proxy:{
type: 'ajax',
api: {
read: 'rest/productionPeriodClosure/list.htm'
},
reader: {
type: 'json',
root: 'data',
idProperty: 'id',
totalProperty: 'total',
messageProperty: 'message'
}
}
});
with that ready the data of a period, now in the Controller of another interface I call that store
var myStore = Ext.create('sistema.store.ProductionPeriodClosureAll').load();
then I try to perform a search:
var posicion = myStore.findBy(function(record,id){
if (record.get ('closeDate') == '2017-09-01') return true; else return false; });
But the result returns me empty, and tried to try with count () to have the value returns but it does not matter.
The objective of these is to compare if a date exists in the store and according to that validate some data.
Thank you in advance.