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
10 days 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]
7 days 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.

New Reply
This reply is
Your name (optional):