So i am now facing a new problem:
I am using the QuickInfo extension and i need the buttons “Details” and “Cancel” to be only visible for authenticated users.
Is that possible? I made those buttons to do nothing for unauthenticated users, but it is not enough, i need them to be invisible.
If this is not possible, another solution would be to make somehow, that anyone could open an event and see the full description of it, without having the buttons to edit or delete it.
You can configure buttons of QuickInfo
docs.dhtmlx.com/scheduler/custom … _bars.html
This configuration affects both side menu and QuickInfo menu.
You can have a logic on page which sets one set of buttons for authenticated users and empty arrya for unauthenticated users.
public virtual ActionResult Index()
{
var sched = new DHXScheduler(this);
sched.LoadData = true;
sched.EnableDataprocessor = true;
if (!Request.IsAuthenticated)
{
sched.Config.icons_select = null;
sched.Config.icons_edit = null;
}
//var context = new DHXSchedulerModelsDataContext();
var context = new SchedulerAuthDataContext();
//if (Request.IsAuthenticated)
if ((User.IsInRole("Vidinis_portalas_admin")) || (User.IsInRole("VSTDS_admin")))
{
var user = context.cmsMembers.SingleOrDefault(u => u.LoginName == this.HttpContext.User.Identity.Name);
sched.SetUserDetails(user, "nodeId", "user_id");
sched.SetEditMode(EditModes.AuthenticatedOnly);
}
else
{
sched.SetEditMode(EditModes.Forbid);
}
sched.Extensions.Add(SchedulerExtensions.Extension.PDF);
DateTime dt = DateTime.Now;
sched.InitialDate = new DateTime(dt.Year, dt.Month, dt.Day);
sched.Extensions.Add(SchedulerExtensions.Extension.QuickInfo);
sched.Localization.Set("lt", false);
return View(sched);
}
Ok so i’ve inserted
sched.Config.icons_select = null;
sched.Config.icons_edit = null;
for unauthenticated users, but the buttons are still visible.
Any ideas what am i missing?
I’ve also noticed that in the tutorial, the property is called .config, but only capital .Config is being recognized in my project.
I found the properties of the buttons inside dhtmlxscheduler.js,
i have disabled
icons_edit: [/*"icon_save", "icon_cancel"*/], icons_select: [/*"icon_details", "icon_edit", "icon_delete"*/], buttons_left: [/*"dhx_save_btn", "dhx_cancel_btn"*/], buttons_right: [/*"dhx_delete_btn"*/]
But this disables all the buttons EXCEPT the quick info buttons. So quick info buttons must have different properties. Anyone knows how to dissable quickinfo buttons? The names of the properties?