change colors of cells in timeline view without reloading ?

Hello,
I use the timeline view to display if my ressource is available or not.
I use the timeline_cell_class template for this.
I would like to add a possibility for the user to change the availability of the ressource.
If he click this option, I would like to change the cells classes to reflect this.

I wonder about the way to it.
By trying, I have been able to touch to the cell and acess all cells of the ressource that change.
I delete the class name that is in use to replace it by another one.
It works.

As I will also reflect this change by sending the information to the database, I wonder if there is some way to update the cells by reusing the templates function. (can I for example call the timeline_cell_class ? would an update of the scheduler be enough, but I think it will reload the whole thing, as I would like to reload only cell class ?)

One more thing, it is possible that several ressource share the same calendar, so one change for a ressource can lead to change other ressource as well.
Is there a way to browse through all ressources and cells ressource to reflect the change for all those are concerned ?

Thanks in advance

I wonder if there is some way to update the cells by reusing the templates function.

You can change some properties of events and call
scheduler.setCurrentView(scheduler.getState().date);
Which will repaint the view, and will reapply class templates.

One more thing, it is possible that several ressource share the same calendar

Currently it is not possible, I think It can be achieved with pretty small code modification.

Is there a way to browse through all ressources and cells
There is no way. The cells which you see can be repainted at any moment, so modification of HTML elements is not reliable. It will work better, if you will change some property of events, and trigger view repainting

I am not sure that we speak about the same thing.
I am not speaking about events in the timeline view but the background cells.
Can you give me an example for changing colors of a backgrounf cell and refreshing the scheduler ?

What kind of modification would be needed to apply a same calendar to several ressources ?

Thanks for your help

You probably have some logic in timeline_cell_class , which check some collections of markers and based on it returns cell color. So you can change such markers and call setCurrentView - which will repaint whole view, including cells, and will reuse timeline_cell_class template for it.

What kind of modification would be needed to apply a same calendar to several ressources ?
Check timeline.js ( better take file from sources/ext folder )
in y_scale it has something like

var tevs = scheduler.get_visible_events(); for (var j=0; j<tevs.length; j++){ var ind = this.order[ tevs[j][this.y_property] ]; if (!evs[ind]) evs[ind] = []; evs[ind].push(tevs[j]); }

This method separate single array of events in multiple ones, per property.
You can alter that code to place some event in two arrays, as result it will be rendered for two different ressources.