Can someone please help me. I'm trying to assign dynamically the value of disabledDates attribute of my datefield
xtype: 'datefield',
disabledDates: disabledDates
This is the code to get the store and build the dynamic "disabledDates" array
var storeFechasOcupadas = new Ext.data.JsonStore({
url: 'modules/citas/agendar/server/crudAgendar.php?operation=fechasOcupadas',
root: 'data',
id: 'id',
fields: ['dias_laborables']
});
var disabledDates = [];
storeFechasOcupadas.load({
callback: function(record, operation, success) {
for (var i = 0; i < record.length; i++) {
disabledDates.push(record[i].data['dias_laborables']);
}
}
});
The store response is like this
{"success":true,"data":[
{"id":12,"dias_laborables":"2013-08-10","disponible":false},
{"id":16,"dias_laborables":"2013-08-15","disponible":false}
]}
what I want to get is something like this
disabledDates = ["2013-08-10","2013-08-14","2013-08-15"]
but what I see with console.log(disabledDates)
[]
0 "2013-08-10"
1 "2013-08-15"
2 "2013-08-07"
3 "2013-08-19"
remove function()
__proto__ []
and even if I try to get disabledDates[0] it returns undefined
Thanks in advance for any help