get occurferences

Ask for help related to our Calendar 2.x version
Post Reply
User avatar
sid59
Posts: 10
Joined: Wed Oct 10, 2018 7:42 pm

get occurferences

Post by sid59 » Tue Jan 08, 2019 1:24 pm

Tell me please. I created a separate store with events. I want to get a repetition of events and in the future apply a separate TPL template for them. The getOccurferences () method returns an empty array.
Can I get reps from Ext.app.ViewController?
Or is it a private method and I need to process on the server?

My goal..
ViewModel..

Code: Select all

  workEventStore: {
            type: 'calendareventstore',
            model: 'App.view.worksheduler.model.Event',
            listeners: {
                load: 'onWrkEventStoreLoad',
            },
            autoLoad: true,

            proxy: {
                type: 'rest',
                url: 'api/calendarEventList',
                extraParams: {
                    "ure_id": test,
                    "uro_id":  test,
                },
}
Controller..

Code: Select all

onWrkEventStoreLoad: function (store, records, successful, operation, eOpts) {
        Ext.each(records, function (record) {
            console.log('getRecurringEvents')
            // console.log(record.getRecurringEvents())
            console.log('isRecurring')
            console.log(record.isRecurring())
            console.log('isPersistable')
            console.log(record.isPersistable())

            console.log('getOccurrences()')
            console.log(record.getOccurrences())
            console.log('getRecurrence()')
            console.log(record.getRecurrence())
            console.log('getRecurringEvent()')
            console.log(record.getRecurringEvent())
        });
    },
Attachments
My goal.jpg
My goal.jpg (128.48 KiB) Viewed 39 times

User avatar
pmiklashevich
Core Developer
Core Developer
Posts: 735
Joined: Fri Apr 01, 2016 11:08 am

Re: get occurferences

Post by pmiklashevich » Tue Jan 08, 2019 6:16 pm

Please provide a fully runnable test case so we can investigate it. Also please pay attention to the occurrencesready event, which is fired when occurrences are generated. Note it's an async process and occurrences will be regenerated whenever timespan is changed or data is reloaded. Also please note that you can style your occurrences based on 'cal-event-occurrence' and 'cal-event-recurring' CSS classes.
Pavel Miklashevich - Core Developer

User avatar
sid59
Posts: 10
Joined: Wed Oct 10, 2018 7:42 pm

Re: get occurferences

Post by sid59 » Tue Jan 08, 2019 7:16 pm

occurrencesready - exactly what is needed, thank!

Post Reply