Premium support for our pure JavaScript UI components


Post by gorakh.nath »

<BryntumSchedulerPro
         resources = {data.resources || []}
          timeRanges={data.timeRanges || []}
         resourceTimeRanges={data.resourceTimeRanges || []}
          eventsVersion = {eventsVersion.current}
          resourceTimeRangesFeature={true}
          resourceNonWorkingTimeFeature = {true}
          nonWorkingTimeFeature={ true }
          startDate = {startDate}
          visibleDate = {new Date()}
          endDate = {endDate}
          events = {data.events || []}
          project ={ {
            timeRangeStore: timeRangeStores,
            resourceTimeRangeStore: resourceTimeRangeStore,
            calendar: 'weekend',
            calendarsData: data.calendars
          }}
/>

In the above code resources and events I manage to handle the above scenario that is updating data dyynamically from api call after scheduler has been initialized.
Same issue is coming for calendarsData also and even if I will write calendarsData:data.calendars || [] it is not working.
the verison I am using is:-

"@bryntum/schedulerpro": "^4.1.2",
"@bryntum/schedulerpro-react": "^4.1.2"

I saw one of the forum that has the similar issue but in Angular viewtopic.php?f=44&t=17322&p=85946&hilit=resourceTimeRangeStore+of+%23%3CSchedulerPro%3E+which+has+only+a+getter#p85946
Is this has been fixed , What change I should do.


Post by mats »

If you encounter an error, please always include

  1. full error message
  2. simple test case so we can reproduce.

You can find full forum rules here: viewtopic.php?f=1&t=772


Post by gorakh.nath »

@mats
Error message:-
TypeError: Cannot set property resourceTimeRangeStore of #<SchedulerPro> which has only a getter

Attachments
Screenshot 2021-07-29 at 3.11.39 PM.png
Screenshot 2021-07-29 at 3.11.39 PM.png (399.21 KiB) Viewed 552 times

Post by saki »

The documentation states:

Screen Shot 2021-07-30 at 14.37.23.png
Screen Shot 2021-07-30 at 14.37.23.png (68.28 KiB) Viewed 533 times

The blue circle with c means that it is config-only option and the text states: "The initial data". That means that you cannot change it at runtime.

At runtime, the calendars data is either delivered from the server as a part of the response as described here: https://bryntum.com/docs/scheduler-pro/#SchedulerPro/guides/basics/calendars.md or you need to use https://bryntum.com/docs/scheduler-pro/#SchedulerPro/data/mixin/PartOfProject#property-calendarManagerStore and manipulate its data.


Post by gorakh.nath »

@saki It is working fine for first render but if we re-render the page then it is not showing showing data and it become empty. I attached the simple sample application to reproduce the issue. Please check once and let us know what change we will have to do.

Attachments
CalendarData.zip
(2.98 MiB) Downloaded 53 times

Post by alex.l »

Hi gorakh.nath,

Basically, we have a bunch of methods to set data after the SchedulerPro has been initialized. If you have full data, better to use https://bryntum.com/docs/scheduler-pro/#Scheduler/model/mixin/ProjectModelMixin#function-loadInlineData

To set calendars after the schedulerPro init, please use https://bryntum.com/docs/scheduler-pro/#SchedulerPro/data/mixin/PartOfProject#property-calendarManagerStore

If you re-rendered your page, you have to take care of your data again. Please check our docs, it has all info how to do that:
https://bryntum.com/docs/scheduler-pro/#Scheduler/guides/data/displayingdata.md
https://bryntum.com/docs/scheduler-pro/#Scheduler/guides/data/crud_manager.md
https://bryntum.com/docs/scheduler-pro/#SchedulerPro/guides/basics/calendars.md
https://bryntum.com/docs/scheduler-pro/#SchedulerPro/guides/basics/project_data.md
https://bryntum.com/docs/scheduler-pro/#SchedulerPro/model/ProjectModel

Keep in mind the difference via configs and properties that Saki mentioned above.

All the best,
Alex


Post Reply