Hi,
The AgendaView offers a floating settings button to allow the user to change the range type.
Is there a way to constrain the ranges displayed in this floating settings button?
Thanks, Ralf
You can do this. See https://www.bryntum.com/docs/calendar/api/Calendar/widget/EventList#property-listRangeMenu
I can improve the docs there.
It returns a Menu configuration object which creates the menu that you see which has this form:
{
items : {
listRangeDayItem : {... config for the DAY range menu item },
listRangWeekItem : {... config for the WEEK range menu item },
listRangMonthItem : {... config for the MONTH range menu item },
listRangeYearItem : {... config for the YEAR range menu item },
listRangeDecadeItem : {... config for the DECADE range menu item }
}
}
I've added to the docs for the next version. They will look like this:
You can create an AgendaView
subclass which overrides get listRangeMenu()
, calls super, to get the result and then just delete
properties from that items
object, then return the result.
In fact, you can use standard mode names, but override the type
which is a string registered in your class definition using this in the class body.
// Factoryable type name
static type = 'singledayagenda'
And this at the bottom of the file:
// Register this class with the widget factory
TheActualClassName.initClass();
That registers the defined type
that you defined as mapping to that class. So you would then use
modes : {
agenda : {
type : 'singledayagenda'
}
}
And it will instantiate your class as the agenda view.