Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用google icalendar的Bryntum日历重现Extjs_Java_Extjs_Calendar_Icalendar - Fatal编程技术网

Java 使用google icalendar的Bryntum日历重现Extjs

Java 使用google icalendar的Bryntum日历重现Extjs,java,extjs,calendar,icalendar,Java,Extjs,Calendar,Icalendar,我正在使用Extjs Bryntum Calendar创建事件,并希望将它们保存为google ics文件,然后再次将事件加载到Sch Calendar中 有谁能告诉我如何从Cal.model.Event转换为ical事件,反之亦然? 数据作为ical数据来自api 我的代码是: 资源存储: Ext.define('my.store.CalendarResource', { extend: 'Cal.data.ResourceStore', storeId: 'resource'

我正在使用Extjs Bryntum Calendar创建事件,并希望将它们保存为google ics文件,然后再次将事件加载到Sch Calendar中

有谁能告诉我如何从Cal.model.Event转换为ical事件,反之亦然? 数据作为ical数据来自api

我的代码是:

资源存储:

Ext.define('my.store.CalendarResource', {
    extend: 'Cal.data.ResourceStore',
    storeId: 'resource',
//    proxy: 'memory',
    model:'my.model.CalendarResource',
    proxy: {
        type: 'rest',
        url: 'api/calendars/scheduler'
    },

});
资源模型:

Ext.define('my.model.CalendarResource', {
    extend : 'Cal.model.Resource',

   fields: [{
        name: 'Id',
        type:'string'
    }, {
        name: 'Name',
        type: 'string'
    }, {
        name: 'Color',
        type: 'string'
    }, {
        name: 'data'
    }]
});
日历视图

Ext.define('my.view.RecurrenceCalendar', {
    extend : 'Cal.panel.Calendar',
    xtype  : 'recurrencecalendar',
    
    requires : [
        'Sch.data.util.recurrence.Legend',
        'my.store.CalendarEvent',
        'my.store.CalendarResource'
    ],

    date          : new Date(),
    eventStore    : 'event',
    resourceStore : 'resource',

    // show the resource filter
    resourceFilter : {
        dock : 'right'
    },

    // Uncomment the below line to disable the recurring events feature
//     recurringEvents : false,

    initComponent : function () {
        var me = this;

        Ext.apply(me, {
            eventRenderer : function (eventRecord, resourceRecord, tplData) {
                var legend = '';

                if (me.recurringEvents && eventRecord.getRecurrence()) {
                    legend = Sch.data.util.recurrence.Legend.getLegend(eventRecord.getRecurrence(), eventRecord.getStartDate());
                }

                return eventRecord.getName() + (legend ? ' | ' + legend : '');
            },
            beforeeventadd : function (me, eventRecord, resources, eOpts) {
                var resourceStore = me.getResourceStore();
                alert('aaaaaaa')
            }
        });
        me.on('eventclick', function ( view, record, e ) {
            var el = e.getTarget(me.getSchedulingView().eventSelector, 10, true);

            me.editor.edit(record, el);
        });
        me.on('eventdbclick', function ( view, record, e ) {
            var el = e.getTarget(me.getSchedulingView().eventSelector, 10, true);

            me.editor.edit(record, el);
        });
        me.on('beforeeventadd',function(me, eventRecord, resources, eOpts){
            alert('123')
        });
        Ext.getStore('resource').reload();
        me.callParent(arguments);
    },
    
    onEventCreated : function (newEventRecord, resources) {
        // Overridden to provide some default values

        var resourceStore = this.getResourceStore();

        if (!newEventRecord.getResourceId()) {
            if (!Ext.isEmpty(resources)) {
                newEventRecord.assign(resources);
            } else if (resourceStore && resourceStore.getCount() > 0) {
                newEventRecord.assign(resourceStore.first());
            }
        }
    },
    
    
});
事件存储:

Ext.define('my.store.CalendarEvent', {
    extend  : 'Cal.data.EventStore',
    storeId : 'event',

});
谢谢。

你做了什么

要将记录另存为iCalendar文件,请执行以下操作:

您可以将记录从
存储
序列化为
.ical
格式()

要将文件作为事件加载,请执行以下操作:

例如,您可以在
文件
输入中收听
更改
,并将
.ical
格式解码为您的模型参数

您可以使用现有的开源库,如

您做了什么

要将记录另存为iCalendar文件,请执行以下操作:

您可以将记录从
存储
序列化为
.ical
格式()

要将文件作为事件加载,请执行以下操作:

例如,您可以在
文件
输入中收听
更改
,并将
.ical
格式解码为您的模型参数


您可以使用现有的开源库,如

Thank You先生,您知道如何从日历事件编辑器捕获事件创建以将其转换为.ical格式吗?您可以在
store
event上收听
Ext.getStore('event')。在('add',函数(store,records,index,eOpts){//对记录执行操作});谢谢,先生,您知道如何从日历事件编辑器捕获事件创建以将其转换为.ical格式吗?您可以在
store
上收听
add
event,如
Ext.getStore('event')。在('add',函数(store,records,index,eOpts){//Do thing with records})