Hi,
i would like to add a button which opens a menu with checkboxes.
If i unselect a checkbox i want that the ressource disappears from view.
How is that possible?
Many thanks,
André
Hey André,
I believe you'll find useful the following documentation https://bryntum.com/products/scheduler/docs/api/Core/widget/Menu
You can set up something like this
const menu = new Menu({
anchor : true,
autoShow : false,
items : [
{
type: 'checkbox',
icon : 'b-fw-icon b-icon-add',
text : 'Add',
onClick: (evData) => {
console.log('click', evData)
// filter the resource store
}
},
]
});
new Button({
appendTo : document.body,
cls : 'b-raised',
text : 'Show menu',
menu
});
and inside that onClick
, you can filter the resourceStore using this function https://bryntum.com/products/scheduler/docs/api/Scheduler/data/ResourceStore#function-addFilter
Best regards,
Márcio
Hi Márcio,
how can i access the resourceStore?
My console.log of scheduler.resourceStore tells me undefined
.
My console.log of scheduler shows me an object, starting with current
.
There can i find the ressourceStore under schedulerPro.current.schedulerProInstance._resourceStore
But is this the correct way to access it?
Working! Many thanks!
But i have another problem with the menu button.
Please have a look.
<BryntumButton
text={'Maschinen auswählen'}
menu={[
{
text: '1010',
checked: false,
},{
text: '1020',
checked: false,
},{
text: '1030',
checked: false,
},{
text: '1040',
checked: false,
},{
text: '1050',
checked: false,
},
]}
></BryntumButton>
When i use this one, then i get an console error
Uncaught (in promise) RangeError: Maximum call stack size exceeded
at _spb (schedulerpro.module.js:53:1)
at bW (schedulerpro.module.js:10:1)
at Menu.set (schedulerpro.module.js:10:1)
at Menu.set (schedulerpro.module.js:10:1)
at Menu.set (schedulerpro.module.js:10:1)
at Menu.set (schedulerpro.module.js:10:1)
at Menu.set (schedulerpro.module.js:10:1)
at Menu.set (schedulerpro.module.js:10:1)
at Menu.set (schedulerpro.module.js:10:1)
at Menu.set (schedulerpro.module.js:10:1)
Hey burnit,
Which version are you using? In the latest (5.2.9) I tested this one and worked just fine (check the video attached)
<BryntumButton
text={'Maschinen auswählen'}
menu={[
{
text: '1010',
checked: false,
},{
text: '1020',
checked: false,
},{
text: '1030',
checked: false,
},{
text: '1040',
checked: false,
},{
text: '1050',
checked: false,
},
]}
></BryntumButton>
Best regards,
Márcio
alex.l wrote: ↑Fri Feb 03, 2023 1:32 pmThere is a flag https://bryntum.com/products/scheduler/docs/api/Scheduler/data/ResourceStore#property-isFiltered
and event https://bryntum.com/products/scheduler/docs/api/Scheduler/data/ResourceStore#event-filter
Hi alex,
i need to know, which resource is filtered. Is there any way?
a general information about if the resource store is filteres is not needed.
Greetings,
André