Our pure JavaScript Scheduler component


Post by zvondic »

Hello,
i am testing demo extjsmodern.
I replace:
eventStore: {
            readUrl: 'data/events1.json',
            autoLoad: true
        },

        resourceStore: {
            readUrl: 'data/resources1.json',
            autoLoad: true
        }
with
bind: {
            rowHeight: '{rowHeight}',
            resourceStore:'{resourceStore}',
            eventStore:'{eventStore}'

        },
and ViewModel:
 viewModel: {
        data: {
            rowHeight: 45
        },
        stores: {
            eventStore: {
                type: 'cache',
                model: 'Tree.model.scheduler.Event',
                autoLoad: true
            },

            resourceStore: {
                type: 'cache',
                model: 'Tree.model.scheduler.Resource',
                autoLoad: true
            },
        }
    },
There is some error :
scheduler.umd.js:10 Uncaught TypeError: Cannot read property 'relations' of undefined
    at _0x598115.initRelations (scheduler.umd.js:10)
    at _0x598115.construct (scheduler.umd.js:9)
    at _0x598115.construct (scheduler.umd.js:30)
    at _0x598115._0x5e53a8 (scheduler.umd.js:9)
    at _0x598115._0x55eff1 (scheduler.umd.js:12)
    at _0x598115._0x41cc9d (scheduler.umd.js:12)
    at _0x598115._0x28fc0f (scheduler.umd.js:12)
    at _0x598115._0x159f47 (scheduler.umd.js:10)
    at _0x598115._0x1c5247 (scheduler.umd.js:10)
    at _0x598115._0xdeb3cc (scheduler.umd.js:10)
is possible to use for binding store this way ?
Thanks Josef.

Post by Maxim Gorkovsky »

Hello.
Integration is supposed to work in a different way. You can read more in this post: viewtopic.php?f=44&t=11973#p63566
Long story short: you cannot use binding with scheduler stores.

Post by zvondic »

Hello Maxim,
thanks for your answer.
There is next question.
How is possible to add custom parameters to calling ajax store read method ?
viewModel: {
        data: {
            rowHeight: 45,
            params: {procedure:'Employee', Par1:='foo'}
        },
    },
eventStore: {
            readUrl: 'data/events1.json',
            autoLoad: true,
            listeners: {
                beforeLoad: function (sender,) {
                /* is there any chance to access viewModel ?  */
                }
            }
        },
Thanks Josef.

Post by Maxim Gorkovsky »

Params can only be passed to the load method.
Also autoLoad should be disabled in this case, forcing you to load store manually:
// config
eventStore : { autoLoad : false }

// after scheduler is instantiated and event store is created
scheduler.eventStore.load({ procedure: 'Empoyee' })

Post by zvondic »

Hi Maxim,
sorry but i don't know where can i forcing load store method.
Can you help me where to place load method in extjsmodern demo ?
Thanks Josef.

Post by sergey.maltsev »

Hi!

As Maxim suggested place after scheduler is instantiated .
For example add it to initialize method of Scheduler panel.
    initialize : function() {
        var me = this;

        me.on({
            painted : function() {
                me.getScheduler({
                    appendTo : me.bodyElement.dom
                });

                me._scheduler.eventStore.load({ procedure: 'Empoyee' });    <------------- Here goes your code
            },
            single : true
        });
        me.callParent();
    },

Post Reply