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

Scale is always reset to the original Value

Asked by Andrea
8 years ago.

Hi, I'm trying the MVC Daypilot component. I'm using the last version downloaded from the site.

I have added the component using HtmlHelper, and then I have changed the Scale to Week in the OnInit.

This is the Index.cshtml

@Html.DayPilotScheduler("dps", new DayPilotSchedulerConfig
{
BackendUrl = Url.Content("~/Graph/Backend"),
EventResizeHandling = EventResizeHandlingType.CallBack,
EventMoveHandling = EventMoveHandlingType.CallBack,

CellGroupBy = DayPilot.Web.Mvc.Enums.GroupBy.Month,
CellWidth = 19,
TreeEnabled = true,
TreeIndent = 15,
Days = 365,
StartDate = new DateTime(DateTime.Today.Year, 1, 1),
CssOnly = true,
EventHeight = 25
})

<a href="javascript:dps.commandCallBack('next');">Next</a>
<a href="javascript:dps.commandCallBack('previous');">Previous</a>

And this is the Controller:

protected override void OnInit(InitArgs e)
{
Scale = TimeScale.Week;
LoadResources();
UpdateWithMessage("Welcome!", CallBackUpdateType.Full);
}

protected override void OnCommand(CommandArgs e)
{
switch (e.Command)
{
case "refresh":
UpdateWithMessage("Refreshed");
break;
case "next":
StartDate = StartDate.AddYears(1);
Days = Year.Days(StartDate);
Update(CallBackUpdateType.Full);
break;
case "previous":
StartDate = StartDate.AddYears(-1);
Days = Year.Days(StartDate);
Update(CallBackUpdateType.Full);
break;
}
}

The problem is that every time I press Next or Previous the Scale is reset to Day. I have made some tests and if I put the Scale in the Helper directly to Week, then it is always reset to Week. It seems that for some reason the MVC controller is not able to maintain the Scale value. No problem with the WebForm component.

Is it a bug ?

Andrea

Answer posted by Dan Letecky [DayPilot]
8 years ago.

It was a bug, indeed. It should be fixed now in the latest sandbox build (8.2.5833):

http://mvc.daypilot.org/sandbox/

Let me know if the problem persists.

And thanks for reporting the issue!

Comment posted by Andrea
8 years ago.

Hi, thank you for your reply.

I'm trying the new build, but I have a strange problem. I have updated both the DLL and the js file, and the js is version 2201. But every time I run the code it throws an exception saying that I'm still using version 2131.

I have triple-checked and there is only one js file in the project and it is version 2201. Could you help ?

Thanks again.

Andrea

Answer posted by Andrea
8 years ago.

Ok, sorry, Solved. It was the Browser cache.

The Scale problem is also solved in this version.

Thanks again

Andrea

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