Our powerful JS Calendar component


Post by lanpeng »

Hi bryntum team
As the topic describe, i use selectAllItem in ResourceFilter,but it dose not works when i selectTeam .
I upload a demo,please check it .

Attachments
inline-data.zip
(10.59 MiB) Downloaded 40 times

Post by marcio »

Hi lanpeng,

Could you please check the demo that you uploaded? It looks like some files are missing, you need to zip the Angular project without the node_modules and with the package.json inside it.

https://www.bryntum.com/docs/gantt/api/Core/widget/List#config-selectAllItem

Best regards,
Márcio


Post by Animal »

To preselect just a few resources see https://bryntum.com/examples/calendar/resourceview/

    sidebar : {
        items : {
            resourceFilter : {
                // Initially select resource IDs 2, 3 and 4
                selected : [2, 3, 4]
            }
        }
    },

Post by lanpeng »

sorry,my mistake . I uploaded a new demo again .please check it.

Attachments
demo.zip
(376.11 KiB) Downloaded 41 times

Post by Animal »

modeDefaults is a config of Calendar.

https://www.bryntum.com/docs/calendar/api/Calendar/view/Calendar#config-modeDefaults

There is the bug that the timeFormat is not propagated into the time axis used in resource view, but adding it as a config for a view will never have any effect.


Post by Animal »

It looks like you are changing the calendarConfig object which has been used (past tense) to create the calendar in a later function call (initSidebar()) and thinking that will have an effect. It's just an object which has been used.

Just configure the calendar as you want to see it. I see your CalendarConfig has this:

Screenshot 2022-07-20 at 06.54.38.png
Screenshot 2022-07-20 at 06.54.38.png (13.06 KiB) Viewed 505 times

Configure the two UI elements there.

If you want to change things after instantiation, you have to change the running instance

for example:

// Hide the existing resource filter
myCalendarInstance.sidebar.widgetMap.resourceFilter.hide();

Note that selectAllItem is not a dynamic config (setting the property after instantiation will not update the UI)


Post by lanpeng »

thanks. Animal,
but there are still some issue in my demo. i uploaded my demo again.
Step1 . select 't1',the "selectAllItem" works well.
Step2 ,select 't2', the "selectAllItem" can not be selected.
Could you please fix my bug and make it works well?

Attachments
demo.zip
(376.12 KiB) Downloaded 44 times

Post by Animal »

I do not understand that post.

"Step2 ,select 't2', the "selectAllItem" can not be selected."

I have changed our resource view example to use

    sidebar : {
        items : {
            resourceFilter : {
                selectAllItem : true,
                // Initially select resource IDs 2, 3 and 4
                selected : [2, 3, 4]
            }
        }
    }

And it works as expected.

Obviously if you check the "all" item, but then uncheck any of the items, the "all" item becomes unchecked...

I do not know what issue you are facing.


Post by lanpeng »

Hi Animal .May be i did not make it clearly. I uploaded a video .The select All can not be selected after i select the team which name is "t2"

Attachments
媒体1.mp4
(4.02 MiB) Downloaded 40 times

Post by Animal »

I don't think you should do

this.calendarComponent.instance.widgetMap.resourceFilter.selected.add(this.calendar.resourceStore.records)

This will select all:

this.calendarComponent.instance.widgetMap.resourceFilter.selectAll()


Post Reply