How to set the ‘id’ of the resource in scheduler in non-unit configuration (normal scheduler having just Day, Week and Month views).
Event object can’t have any number of custom fields. You can add selectbox control to the lightbox, so during event’s editing you will be able to choose the resource from the select.
Actually in my web page the scheduler will be associated with many resources but in a given time only to one. So i need to know from the scheduler itself to which resource it is currently attached to.
When you are loading data, event object can have extra properties. For example on server side you can use
$sch->render_table("events", "id", "start_date, end_date, text, resource_id")
after that on client side you can get the resource_id like next
scheduler.getEvent(id).resource_id;
Don’t we have something like setting similar to Unit view’s section or setting the property of the scheduler object itself?
Sorry, I’m not sure what setting do you mean.
- it possible to load the “id” of resource from server side
- it possible to get the “id” by js API
- you can use set_options on server side and serverList functionality on client side to load list of resources along with events data
- if you have select list with names of resources - you can use getLabel method to convert “id” to the label
Do you need some other functionality ?
What I am trying to say that in Unit’s view when we creating the section we can associate a section to the resource by setting the resource_id as the ‘key’ parameter, this association is to the section and not just a single event. Is there a similar association if we are using the scheduler in the normal mode?
The per-section event association is the feature of unit and timeline views. In other modes event position ( section ) will be based only on event’s date