有人可以帮帮我吗。我正在尝试动态分配我的日期字段的 disabledDates 属性的值
xtype: 'datefield',
disabledDates: disabledDates
这是获取商店并构建动态“disabledDates”数组的代码
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']);
}
}
});
店铺回复是这样的
{"success":true,"data":[
{"id":12,"dias_laborables":"2013-08-10","disponible":false},
{"id":16,"dias_laborables":"2013-08-15","disponible":false}
]}
我想得到的是这样的
disabledDates = ["2013-08-10","2013-08-14","2013-08-15"]
但是我在 console.log(disabledDates) 中看到的
[]
0 "2013-08-10"
1 "2013-08-15"
2 "2013-08-07"
3 "2013-08-19"
remove function()
__proto__ []
即使我尝试获取 disabledDates[0] 它也会返回 undefined
提前感谢您的帮助