search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

'DayPilot' is not defined

Related article: HTML5/JavaScript Event Calendar (Open-Source)
Asked by Robson Silva
1 year ago.

Ola, não estou conseguindo fazer o calendario aparecer na tela meu código está certinho.

@Html.DayPilotMonth("dp", new DayPilotMonthConfig
{
    BackendUrl = Url.Content("~/Main/Backend"),
    EventMoveHandling = DayPilot.Web.Mvc.Events.Month.EventMoveHandlingType.CallBack,
    EventResizeHandling = DayPilot.Web.Mvc.Events.Month.EventResizeHandlingType.CallBack,
    TimeRangeSelectedHandling = DayPilot.Web.Mvc.Events.Month.TimeRangeSelectedHandlingType.JavaScript,
    TimeRangeSelectedJavaScript = "dpm.timeRangeSelectedCallBack(start, end, { name: prompt('New Event Name:', 'New Event') });"
})

Controller

public ActionResult Index()
        {
            return View();
        }   

        public ActionResult Backend()
        {
            return new Dpm().CallBack(this);
        }

Bundle

bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
                        "~/Scripts/jquery-{version}.js",
                        "~/Scripts/daypilot-all.min.js"
                        ));

Os códigos estão ai porque sera que não consigo mostrar o calendario e aparece o erro do titulo no console?

Answer posted by Dan Letecky [DayPilot]
1 year ago.

Please make sure that daypilot-all.min.js is loaded before the month control initialization code [@Html.DayPilotMonth("dp",....]. If the library is not loaded at that point it will generate an error like this.

Please let me know if it didn't help.

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.