0

I am using DHTMLX nuget package and I'm trying to disable or hide the value on event_bar_date through my aspx.cs

    sched.Templates.event_header = @"<span class='event_date'
          {start_date:date(%g:%s %A)}</span><br></div>";

           sched.Templates.event_bar_header = ??????? 

I found something like this but this but using JS file which Im not familiar with, I want it to be directly on my cs file

scheduler.templates.event_bar_date = function(start,end,ev){
 return "• <b class ='disp_none'>"+scheduler.templates.event_date(start)+"</b> ";

};

Katherine
  • 319
  • 1
  • 4
  • 15

2 Answers2

0

You can do the same config in c#:

var scheduler = new DHXScheduler(); ... scheduler.Templates.event_bar_date = "• ";

http://scheduler-net.com/docs/options-and-templates.html#using_javascript_configuration_with_the_scheduler

Polina
  • 412
  • 2
  • 6
0

You can wrap JS configuration into some function and tell DHXScheduler to call it to initialization on the client side, e.g.

JS:

window.app = {
    configure: function () {
        scheduler.attachEvent("onSchedulerReady", function () {
            scheduler.templates.event_bar_date = function (start, end, ev) {
                return "• ";
            };
        });
    }
};

C#

var scheduler = new DHXScheduler();
scheduler.BeforeInit.Add("app.configure();");

Here is a complete demo, you might need to update nuget package of DHTMLX Scheduler in order to run it

https://s3.amazonaws.com/uploads.hipchat.com/15721/63476/GFsBPty6TaIz13o/schedulernetmonthdatetemplate.zip

Server-side configuration ( scheduler.Templates.event_bar_date = "• "; ) should also work, however seems like this particular template gets rewrited during initialization, that is a reason why i've put it definition into onSchedulerReady handler http://docs.dhtmlx.com/scheduler/api__scheduler_onschedulerready_event.html

Alex Klimenkov
  • 956
  • 1
  • 5
  • 8