I am looking to create a resource view for day view mode, but showing sub-resources for each resource as columns above.
On the screenshot take a look at the first resource "Branch A". It will have a day view, but instead of days of the week as columns, it will have resources within each resource.
Is this possible to achieve, if so how can this be created?
It isn't possible currently, but we would be open to implementing it for you as part of our Feature Sponsorship offering. Please see this page for details: https://www.bryntum.com/services/
If interested, please reach out to [email protected] and we can set up a call to discuss.
If I were to do this this would be along the lines of the following code (YMMV, this is off the top of my head, but a start)
export default class BranchResourceView extends Container.mixin(DateRangeOwner, CalendarMixin) {
static configurable = {
// We don't add mouse listeners. We just relay events from the children
handlePointerInteraction : false,
// The child views will make us need to scroll left/right
scrollable : { x : true }
};
doRefresh() {
// iterate the branchStore
// Create a DayResourceView for each one with an eventFilter property which filters in only events for the branch
// Obviously cache them and only create a view if one does not already exist for the branch.
// Configure them with project : this.project
// Configure them with a catchAll listener pointing to this.relayChildViewEvents as the handler
// Configure them with range : this.range (We are a DateRangeOwner, so probably have '1 week')
// add the views (This is a Container, it contains child Widgets)
}
relayChildViewEvents() {
// trigger the events from here so the Calendar handles them
}
// Inherited from Container. We get to look at new child widgets
onChildAdd(child) {
super.onChildAdd(child);
// We get a look at child view config changes to see if we need to propagate them to their siblings
FunctionHelper.before(child, 'onConfigChange', 'onChildViewConfigChange', this, { return : false });
}
}
You would add a branchesStore to your CrudManager which would load the branches up along with all the other data (resources, events etc) in one block.
There will be a lot more to it than that, but that's the principle. A Container which manages a child DayResourceView for each Branch.
I wouldn't think twice to go for the Feature Sponsorship, the only inconvenience is that the client takes quite a bit of time to approve any additional service, and we need this for our current sprint. I will talk with the team anyway.
I tried putting together the code above, but has many type errors.
The team decided to pivot to another alternative solution with scheduler pro, as if we wait to get approval for this we would compromise our current sprint. It would have been great to have such feature available on the resource view part of the core - I initially thought it was possible.
Again, thank you all for being so responsive and for your great product.
I created a ticket to implement that https://github.com/bryntum/support/issues/9897, but as it's very specific for now, it would have top priority on development. If you want to speed up that process, please ping our services as Mats mentioned earlier on this thread.