0

我正在使用可扩展日历并尝试使自定义 ajax 存储与此一起使用,但是当存储加载时出现此错误 在此处输入图像描述

所以日历不显示日期,这里有一些代码

Ext.apply(Extensible.calendar.data.EventMappings, {

        StartDate:   {name: 'fecha_reservacion', mapping: 'fecha_reservacion', type: 'date', dateFormat: 'c'},

    });
 Extensible.calendar.data.EventModel.reconfigure();

var eventStore = Ext.create('Ext.data.Store', {

        fields: [
            {name: 'id', type: 'int'},
            {name: 'fecha_reservacion', type: 'date', dateFormat: 'c'},
        ],
        proxy: {
            type: 'ajax',
            url: '/reservacion/get',
            reader: {
                type: 'json'

            }
        },
        autoLoad: true
});

Ext.create('Extensible.calendar.CalendarPanel', {
        eventStore: eventStore,
        calendarStore: calendarStore,
        renderTo: 'content',
        title: 'Custom Event Mappings',
        width: 800,
        height: 700,
    });
4

1 回答 1

0

你的映射错误name: 'fecha_reservacion'应该是name: 'StartDate'

Ext.apply(Extensible.calendar.data.EventMappings, {
    StartDate:   {name: 'fecha_reservacion', mapping: 'fecha_reservacion', type: 'date', dateFormat: 'c'},
    // add here all your fields 
});

您还必须为其他字段添加映射。

于 2015-01-11T23:54:46.167 回答