【问题标题】:Extjs Extensible Calendar data[M.EndDate.name] is undefinedExtjs 可扩展日历数据[M.EndDate.name] 未定义
【发布时间】:2014-03-26 17:58:54
【问题描述】:

我正在使用可扩展日历并尝试使自定义 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,
    });

【问题讨论】:

    标签: javascript extjs calendar extensible


    【解决方案1】:

    你的映射错误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 
    });
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-08-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多