I create a scheduler with two units view each containing of people and I like that each person can only modify the event that you create.
This approach is used in the samples in scheduler package: dhtmlxScheduler/samples/02_customization/shared_events
I want to pass in parametre the section_id. How ?
scheduler.load(“common/events.php?uid=”+scheduler.uid());
I want to retrieve the section_id of a unit view in the function unit for make a condition “if”.
The question isn’t clear enough. Please provide more details.
In my BDD, i save a section_id of my unit view in the table events.
Event_id , Start_date , end_date , details , section_id
1 00/00/0000 00/00/0000 sdfsd 1
I want in the fonction init() for the page index.php retrieve the section_id of every event to make it a condition.
if(section_id == …){
…
}
Thank you
You can try to use onEventLoading event: dhtmlx.com/dhxdocs/doku.php?id=d … entloading
scheduler.attachEvent(“onEventLoading”, function(event_object){
var section_id = event_object.section_id;
/your code here/
return true
});
scheduler.attachEvent(“onEventLoading”, function(event)
{
var section_id = event.secton_id;
if(section_id == identifiant)
{
return scheduler.config.icons_select=[“icon_details”,“icon_edit”,“icon_delete”];
}
else
{
return scheduler.config.icons_select=[“icon_details”,“icon_edit”];
}
});
This code doesn’t works. I want for the event published by one persons (section_id) and the user connect (identifiant) display 3 icons (details,edit,delete).
Example:
section_id = 1 and identifiant = 1 ======> scheduler.config.icons_select=[“icon_details”,“icon_edit”,“icon_delete”];
section_id = 1 and identifiant = 2 ======> scheduler.config.icons_select=[“icon_details”,“icon_edit”];
Do you speak french?
There is no public method to do that.
You can try to apply the following approach:
var setter = scheduler.select;
scheduler.select=function(id){
var event = scheduler.getEvent(id);
var section_id = event.secton_id;
if(section_id == identifiant) scheduler.config.icons_select=[“icon_details”,“icon_edit”,“icon_delete”];
else scheduler.config.icons_select=[“icon_details”,“icon_edit”];
setter.apply(this,arguments);
}
This approch doesn’t works.
scheduler.attachEvent(“onEventLoading”,function(ev){
var Obj = eval (ev);
if(Obj[‘section_id’] == identifiant)
{
scheduler.config.icons_select=[“icon_details”,“icon_edit”,“icon_delete”];
}
else
{
scheduler.config.icons_select=[“icon_details”,“icon_edit”];
}
I use this approach but it displays for all events regardless of the identifier : scheduler.config.icons_select=[“icon_details”,“icon_edit”,“icon_delete”];
There was a typo in the code snippet that we provided before.
Here should be
var section_id = event.section_id;
instead of var section_id = event.secton_id;
this approach works:
var setter = scheduler.select;
scheduler.select=function(id){
var event = scheduler.getEvent(id);
var Obj = eval(event);
if(Obj[‘section_id’] == identifiant)
{
scheduler.config.icons_select=[“icon_details”,“icon_edit”,“icon_delete”];
}
else
{
scheduler.config.icons_select=[“icon_details”];
}
setter.apply(this,arguments);
}
But i want to desactivate the button save an delete for the user.
The latest scheduler version supports read-only details form:
scheduler.config.readonly_form = true;
My version supported only scheduler.readonly.
Will I have the latest version.
I’m download the latest version but scheduler.config.readonly_form = true; doesn’t works the form is always modifiable
Please, check the sample in the scheduler package dhtmlxScheduler/samples/03_extensions/12_readonly_form.html