Results 1 to 2 of 2

Thread: Sencha Calendar Events are not syncing with server

  1. #1
    Sencha User
    Join Date
    Apr 2007
    Posts
    39
    Answers
    2

    Default Answered: Sencha Calendar Events are not syncing with server

    I've put the calendar as items in a panel, as below. Both the calendars and the saved events load correctly. However, when I add or edit an event, the sync does not happen.

    What am I missing?

    PHP Code:
    ,items: [{
      
    xtype'calendar-day'
      
    ,flex1
      
    ,value: new Date(2017519)
      ,
    visibleDays1
      
    ,flex1
      
    ,startTime0
      
    ,endTime24
      
    ,store: {
        
    autoLoadtrue
        
    ,autosynctrue
        
    ,proxy: {
          
    type'rest'
          
    ,url'http://localhost:9292/calendars/1'
          
    ,reader: {
            
    type'json'
            
    ,rootProperty'values'
          
    }
        }

        ,
    eventStoreDefaults: {
          
    autoLoadtrue
          
    ,autosynctrue
          
    ,proxy: {
            
    type'rest'
            
    ,url'http://localhost:9292/calendars/1/events'
            
    ,reader: {
              
    type'json'
              
    ,rootProperty'values'
            
    }
          }
        }
      }
    }] 
    Last edited by abhijit; 6 Jul 2017 at 7:26 AM. Reason: Solution posted

  2. Found the solution. I need to trap events on the panel and sync the event store. If anybody has a better solution, I would certainly like to know.

    PHP Code:
    ,items: [{
      
    xtype'calendar-day'
      
    ,flex1
      
    ,value: new Date(2017519)
      ,
    visibleDays1
      
    ,flex1
      
    ,startTime0
      
    ,endTime24
      
    ,store: {
        
    autoLoadtrue
        
    ,autosynctrue
        
    ,proxy: {
          
    type'rest'
          
    ,url'http://localhost:9292/calendars/1'
          
    ,reader: {
            
    type'json'
            
    ,rootProperty'values'
          
    }
        }

        ,
    eventStoreDefaults: {
          
    autoLoadtrue
          
    ,autosynctrue
          
    ,proxy: {
            
    type'rest'
            
    ,url'http://localhost:9292/calendars/1/events'
            
    ,reader: {
              
    type'json'
              
    ,rootProperty'values'
            
    }
          }
        }
      }
    ,
    listeners: {
        
    eventadd: function(daycalcontext){
          
    console.info('eventadd');
          
    context.event.store.sync();
        }
        ,
    eventedit: function(daycalcontext){
          
    console.info('eventedit');
          
    context.event.store.sync();
        }
        ,
    eventresize: function(daycalcontext){
          
    console.info('eventresize');
          
    context.event.store.sync();
        }
        ,
    eventdrop: function(daycalcontext){
          
    console.info('eventdrop');
          
    context.event.store.sync();
        }
      }
    }] 

  3. #2
    Sencha User
    Join Date
    Apr 2007
    Posts
    39
    Answers
    2

    Default

    Found the solution. I need to trap events on the panel and sync the event store. If anybody has a better solution, I would certainly like to know.

    PHP Code:
    ,items: [{
      
    xtype'calendar-day'
      
    ,flex1
      
    ,value: new Date(2017519)
      ,
    visibleDays1
      
    ,flex1
      
    ,startTime0
      
    ,endTime24
      
    ,store: {
        
    autoLoadtrue
        
    ,autosynctrue
        
    ,proxy: {
          
    type'rest'
          
    ,url'http://localhost:9292/calendars/1'
          
    ,reader: {
            
    type'json'
            
    ,rootProperty'values'
          
    }
        }

        ,
    eventStoreDefaults: {
          
    autoLoadtrue
          
    ,autosynctrue
          
    ,proxy: {
            
    type'rest'
            
    ,url'http://localhost:9292/calendars/1/events'
            
    ,reader: {
              
    type'json'
              
    ,rootProperty'values'
            
    }
          }
        }
      }
    ,
    listeners: {
        
    eventadd: function(daycalcontext){
          
    console.info('eventadd');
          
    context.event.store.sync();
        }
        ,
    eventedit: function(daycalcontext){
          
    console.info('eventedit');
          
    context.event.store.sync();
        }
        ,
    eventresize: function(daycalcontext){
          
    console.info('eventresize');
          
    context.event.store.sync();
        }
        ,
    eventdrop: function(daycalcontext){
          
    console.info('eventdrop');
          
    context.event.store.sync();
        }
      }
    }] 

Similar Threads

  1. Calendar trouble: calendar.events not a function
    By fairport in forum Ext JS 6.x Q&A
    Replies: 1
    Last Post: 26 Jan 2017, 9:19 PM
  2. Syncing data to device (IOS or Android) Calendar
    By Srinivas N in forum Sencha Touch 2.x: Q&A
    Replies: 3
    Last Post: 15 Jul 2013, 1:32 AM
  3. how to add events in calendar using sencha touch without using phonegap
    By nandhinidavi in forum Sencha Touch 1.x: Q&A
    Replies: 2
    Last Post: 27 Dec 2011, 9:17 PM
  4. Replies: 2
    Last Post: 7 Dec 2011, 3:18 PM
  5. Date Syncing Problem in Ext JS Calendar
    By Spec.manjush in forum Ext 3.x: Bugs
    Replies: 0
    Last Post: 26 Jun 2011, 8:13 PM

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
  •