Our pure JavaScript Scheduler component


Post by GopNovel »

Hi Team,

I was using scheduler-vanilla-4.0.0-alpha-2. Now I downloaded scheduler-4.0.0 from customer zone which was released now. My application is react.

I copied BryntumScheduler.js from examples/react/_shared/src/lib to the components dir where I was using the file before and then copied all the contents in the build folder to a folder I have.
And in package.json

"dependencies": {
      "bryntum-scheduler": "file:third_party/bryntum-scheduler",

}

I have ran npm install.

import { Scheduler, ObjectHelper, Widget } from 'bryntum-scheduler/scheduler.umd';

I see this line active in BryntumScheduler.js file. I get the error

Error: Bundle included twice, check cache-busters and file types 

If I remove and just import from bryntum-scheduler, I get the error

Error: Invalid type name "Array" passed to DataField factory

I am not what I am missing to do? Can you please help me.


Post by alex.l »

Hi GopNovel,

This error may happen if you used both versions - umd and not umd in your imports. Please check the whole app and update it with umd version imports only. It should fix this problem.

Will be glad to hear back from you if it solved this problem.

All best,
Alex

All the best,
Alex


Post by GopNovel »

Hi Alex,

It did help. I used the 'umd' version imports everywhere in the project.

import { TimeSpan, ResourceStore, AssignmentStore, EventModel, AjaxStore, DateHelper, Toast, WidgetHelper, ViewPreset } from "bryntum-scheduler/scheduler.umd.js";

But now I am getting a different issue.

Unhandled Rejection (TypeError): date.getTime is not a function
Function.betweenLesser
Attachments
1.JPG
1.JPG (45.29 KiB) Viewed 9001 times

Post by GopNovel »

I was trying to remove each and everything I was using and putting back each options to see where it is breaking.
When I put timeRanges this above mentioned error came.

timeRangesFeature={{
                        store               : TimeRanges,
                        showCurrentTimeLine : false,
                        showHeaderElements  : false
                    }} 

Any idea what would have broken it.


Post by alex.l »

Hi GopNovel,

That's hard to say with only 4 lines of code, but I got an idea and checked it with our React example. Very possible I'm right.
I am not sure what is TimeRanges variable contains, but if it starts with a capital letter, I may suppose it's just a store class.
https://www.bryntum.com/docs/scheduler/#Scheduler/feature/TimeRanges#config-store
But we are expecting there a config object or an initialized store object, not a class. Try to change it to:

store : new TimeRanges(),

I tried it with our examples and got the same error if I used a class instead of initialized store.
If I am wrong, please prepare a runnable test case for us and attach it here, or try to reproduce the problem with one of our examples.

All best,
Alex

All the best,
Alex


Post by GopNovel »

Hi Alex,

Sorry for late reply.

I am not sure what is TimeRanges variable contains, but if it starts with a capital letter, I may suppose it's just a store class.

Yea it was just the store class I was trying to call.
I tried to the way you asked, but it showed me "TypeError: Illegal constructor".

I was not able to reproduce the error with your examples. For now when I remove the store part from the code and use just like below

timeRangesFeature={{                 
showCurrentTimeLine: true, showHeaderElements: false }}

Scheduler does show the current timeLine and also I am able to see the timeRange response from server. So I hope it is okay to put just like above?


Post by alex.l »

Hi GopNovel,

Glad to hear you are unblocked. Of course, it is not required to define a class for timeRanges store. You still may specify a store as an object if you'll need in that.
Regarding the error.
You can find an example how to define a TimeRange store class in the recurringtimeranges demo.

class MyTimeRangeStore extends RecurringTimeSpansMixin(Store) {
    static get defaultConfig() {
        return {
            // use our new MyTimeRange model
            modelClass : MyTimeRange,
            storeId    : 'timeRanges'
        };
    }
}

All best,
Alex

All the best,
Alex


Post Reply