Our pure JavaScript Scheduler component


Post by ran »

hi,
im using React js, and implemented the scheduler component.
after editing events ( resize/drag and drop etc) im trying to get the updated events from the event store,
but im getting the old store data while making a submit, referencing the engine as such:
this.refs.scheduler.schedulerEngine.
i have tried to set the events on the state and on the props, doesnt seem to make a difference.

also im getting an error each time im pressing an event:
typeError: Cannot read property 'preventDefault' of undefined
    at Navigator.onTargetMouseDown (scheduler.module.js?e19d:27)
    at HTMLDivElement._0x5caaab (scheduler.module.js?e19d:9)
i dont know if the two are related..
thank you!

Post by mats »

The error you found is already fixed.
but im getting the old store data while making a submit, referencing the engine as such:
How are you reading the data? Can you please share an example?

Post by ran »

im using the 3.0.0 trial version forgot to mention..

sure, lets say this simple example:
export default class SchedulerPage extends Component {
...
onSubmit=()=>{
  const scheduler = this.refs.scheduler.schedulerEngine;

** expected new data**
  let newData = scheduler.eventStore.data;
}
 
  render() {
    return (
      <div className="scheduler-page">
                    <BryntumScheduler
                    ref={'scheduler'}/> 
        </div>
    );
  }
};

Post by saki »

Would you please give us a showcase that we can run and debug? Ideally, one of our demos modified to show the issue.

Post by ran »

sure.
attached proj. sorry its not a create app script as you mentioned before, im dont know exactly how to do it..
im using npm 12.14.1
Attachments
plataine-client6.rar
(4.15 MiB) Downloaded 135 times

Post by saki »

I'm trying to run the above code and `npm i` finished without error but npm start gives me:
saki@jsMacR:plataine-client> npm start

> Plataine-Client@4.6.0 start /Users/Shared/data/devel/tmp/plataine-client6/plataine-client
> set DEBUG=true& set Index=mat& set SERVERPORT=3001& node server.js

 ___________________________________
< Listening at localhost: undefined >
 -----------------------------------
        \   ^__^
         \  (zZ)\_______
            (__)\       )\/\
             ש  ||----w |
                ||     ||
(node:47371) DeprecationWarning: loaderUtils.parseQuery() received a non-string value which can be problematic, see https://github.com/webpack/loader-utils/issues/56
parseQuery() will be replaced with getOptions() in the next major version of loader-utils.
[BABEL] Note: The code generator has deoptimised the styling of "/Users/Shared/data/devel/tmp/plataine-client6/plataine-client/infrastructure/js/bryntum/build/scheduler.module.js" as it exceeds the max of "500KB".
It looks like an environment files/variables are missing.

Post by ran »

mm iv unzipped it and it works.. the issue is that it should be 'Listening at localhost: 3001' no to undefined.
its the same project iv sent on this topic which you made it work:
viewtopic.php?f=44&t=13114

just with the implementation of the scheduler as mentioned earlier to get the new data.

Post by saki »

There was another problem in the above thread: we got the compilation errors. Now we have runtime problem so I need to run the app somehow.

In server.js of your app, you use some environment variable that I don't have defined (SERVERPORT, Index, probably more).

Adjust please your app so that it would run here, then we can debug it.

Post by ran »

we did, but we made it work eventually..see the last package..
ill try to see whats wrong in the current one, although it runs..

Post by saki »

I was never able to RUN it. I only COMPILED it and so did you. In any case, It's not runnable here, most likely due to missing environment variables in server.js. I cannot guess their correct values (except SERVERPORT that should be 3001).

Post Reply