Results 1 to 3 of 3

Thread: How to use calendar eventStore in memory?

  1. #1
    Sencha Premium Member
    Join Date
    Jun 2018
    Posts
    6

    Default How to use calendar eventStore in memory?

    Hi,
    I'm using extjs 6.5 and I'm trying to use 'Ext.calendar.panel.Panel'.
    I have set a store with data and a memory proxy and this works fine, but when I try to set a eventStore or a eventStoreDefault with a memory proxy the system give me an error.
    I need to use these store with a memory proxy so I can load them from code with loadData().

    The error is:

    EventSource.js:170 Uncaught TypeError: store.hasRangeCached is not a function

    The code is:
    Code:
    var eventList = {
        "evts": [{
            "id": 1001,
            "calendarId": 1,
            "startDate": "2018-06-30T21:30:00.000Z",
            "endDate": "2018-06-30T22:30:00.000Z",
            "title": "Watch cartoons",
            "description": "Catch up with adventurers Finn and Jake"
    }]
    };
    
    var eventsstore=new Ext.data.JsonStore({
    //var eventsstore=Ext.create('Ext.calendar.store.Events',{
        id: 'eventStore',
        root: 'evts',
        data: eventList, // defined in event-list.js
        proxy: new Ext.data.MemoryProxy(),
        fields: ["id","calendarId","startDate","endDate","title","description" ],
        sortInfo: {
           field: 'StartDate',
           direction: 'ASC'
        }   
     });
    
    
    Ext.define('CalendarStore',{
        extend:'Ext.calendar.store.Calendars',
    
        alias:'store.calendarstore',
        data:{calendars:
            [{
            "id":1,
            "title": "Disponibilità",
            "color": "blue",
            "hidden": "false",
            "editable": "true",
            "eventStore":"eventsstore"
            }]
        },
        proxy: {
            type: 'memory',
            reader: {
                type: 'json',
                rootProperty:'calendars'
            }
        },
    
       eventStoreDefaults: eventsstore
    });
    
    
    Ext.define('Test.view.calendar.CalendarWeekWindow',{
        extend:'Ext.window.Window',
        xtype:'calendar-week-window',
        
        requires: [
            'Ext.calendar.panel.Panel',
            'Test.store.Calendar',
            'Test.view.calendar.CalendarModel',
            'Test.view.calendar.AddCustomEvent'
        ],
    
        closable:true,
        resizable: false,
        draggable: false,
        modal:true,
        autoShow:true,
        defaults: {
            bodyPadding: 20,
        },
    
        width: 1200,
        height: 600,
    
        layout: 'fit',
        items: [{
            xtype: 'calendar',
            
            store:{
                type:'calendarstore'
            },
    
            model:'calendar',
            views: {
                day: {
                    startTime: 0,
                    endTime: 24
                },
                month:{
                    xtype: 'calendar-month',
                    firstDayOfWeek: 1,
                    addForm:{
                        xtype: 'add-custom-event'
                    },//Ext.create('Test.view.calendar.CustomEventForm'),
                }
            },
            timezoneOffset: 0,
            listeners:{
                close:function(panel){
                    panel.destroy();
                }
            }
        }]
    });
    
    Any ideas on how I can solve this problem?
    Thanks in advance.

  2. #2
    Sencha Premium User
    Join Date
    Jul 2015
    Posts
    7

    Default

    I have the same problem! Is the problem resolved?

  3. #3
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250
    Answers
    758

    Default

    The short answer is that you can't at the moment. It wouldn't take a great deal of effort to make that happen though.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

Similar Threads

  1. calendar 5.0.0. doesn't work on touch devices
    By 100-IT in forum Ext 5: Q&A
    Replies: 1
    Last Post: 28 Jan 2015, 12:58 AM
  2. Replies: 2
    Last Post: 17 Apr 2012, 5:17 AM
  3. Calendar doesn't work with my combos
    By NightAvatar in forum Ext 2.x: Help & Discussion
    Replies: 9
    Last Post: 27 Jan 2009, 5:09 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •