Our powerful JS Calendar component


Post by lanpeng »

Hi Animal .
I am sorry that i may not have made it clear .But the new API sounds very useful .
I am facing a problem at present .

const { resourceFilter } = this.calendar.widgetMap;

resourceFilter.selected.add(resourceFilter.store.getById(this.resourceGroup.id));

I want to add a lot of data into resourceFilter.selected at one time .And these data are generated dynamically. I've tried using circular addition, but that's not working.

 this.menbersList.forEach((item:string)=>{
                    this.calendar.widgetMap.resourceFilter.selected.add(this.calendar.resourceStore.getById(item))
                  })

this.membersList is a collection of resourceId
Any good solution for me?


Post by lanpeng »

Your new API may be released in the next version, I need another solution now


Post by Animal »

I still do not get it.

"I want to add a lot of data into resourceFilter"

I do not understand that.

You cannot just add arbitrary data into the resourceFilter's selected Collection.

You have to add resourceRecords which are present in the resourceStore.

That will work. Anything else will not work.


Post by lanpeng »

please see the video.
Although the item of the resourcefilter is selected, the calendar on the right does not display the corresponding resourceview. However, when I deselect it and then select it again, the view on the right can be displayed .
Another question:Is there any api to select all items in resourceFilter?

Attachments
VID_20220325_182430_0_COMPRESSED.mp4
(28.76 MiB) Downloaded 54 times

Post by Animal »


Post by Animal »

So that's a whole new set of resources?

They all need to be loaded into the Calendar's ResourceStore. The resourceFIlter is not where resources exist. Resources are not loaded there.

They are in the Calendar's resourceStore.

Do you always run without the debugger panel open? I always run with it open. As a developer you need that information.


Post by lanpeng »

Hi Animal .
I really set a whole new set of resources after select a team.

this.calendar.project.loadInlineData({
        eventsData:totalData,
        resourcesData:this.resourceGroup
      })
      // @ts-ignore
      this.calendar.widgetMap.resourceFilter.selected.add(this.calendar.resourceStore._data)

Am I wrong?


Post by Animal »

Yes.

As I keep saying. The selected Collection must contain records.

Records that the ResourceStore contains.

this.calendar.resourceStore._data is not records. It is the raw data which you just sent into the resourceStore to become records. It's not documented. _ properties are private anyway and should not be used.

Stores hold records which are live Objects which have properties which update the store when they change. Which have methods which you can call on them.

This is an Object Oriented system. This is not like our competitors where it's all just blobs of data. A Calendar holds real Event objects. And when you pop up the dropdown to select resources. The Combobox's Store contains real Resources.

this.calendar.widgetMap.resourceFilter.selected.add(this.calendar.resourceStore.records));

https://www.bryntum.com/docs/calendar/api/Core/data/Store#property-records


Post by lanpeng »

thanks Animal . The problem is solved


Post Reply