ASP.NET MVC scheduler control GetData action parameters

I have an issue that requires the control to be able to assign parameters to the action that will be called in ASP.NET MVC. I currently only see the control calling a method/action.

Is there a way to do this when setting up the scheduler?

Or is there a custom event I need to tap into that is a part of the scheduler control?

tryscheduler.Data.Loader.AddParameter(key, value);//pass param to the data action scheduler.Data.DataProcessor.AddParameter(key, value);//pass param to the save action

So how would you get the value from the GetData method? I’ll go ahead and add a parameter, but looking at it, it is adding it to a dictionary when setting up the scheduler. If I would have to iterate over a dictionary inside the method, then it will not help as I cannot tell which value to grab as I have multiple calendars loading. If it will actually pass in the parameter into the GetData method, then it would help, going to do a small test today to find this out.

parameters will be added to the request url,
you can get them from Request.QueryString or Request.Params collections

public ActionResult Index() { var sched = new DHXScheduler(this); scheduler.Data.Loader.AddParameter("name", "value"); sched.LoadData = true; return View(sched); } public ContentResult Data() { var value = this.Request.QueryString["name"]; ... }

Here is the real problem, I am trying to dynamically create the scheduler control based upon data.

So imagine multiple DHXScheduler controls being created at the same time. So when the scheduler is being created, I am adding parameters like so:

scheduler.Data.Loader.AddParameter(“ProviderId” + provider.ProviderId.ToString(), provider.ProviderId.ToString());//pass param to the data action

The problem I see is in the “GetSchedulerData” method, it has no scope of how to associate an objects value if this is done dynamically though right? I can access the querystring, but it is not coupled to the DHXScheduler object itself. The “GetSchedulerData” method only returns back Json and has no parameters. Is there a way to do this?

Ideally, I would think that the control would have properties that expose custom events that have the event args so I could access the original sender of an action, but I don’t see that here. It would give me the ability to access anything dynamically. Currently, I know we are given the ability of declaring methods explicitly, but I have nothing to tie things back to.

I tried to do this:

scheduler.DataAction = “GetSchedulerData/1”;

to pass in a value into the action method called.

So the method would look like this:

public ContentResult GetSchedulerData(int id)

The parameters dictionary contains a null entry for parameter ‘providerId’ of non-nullable type ‘System.Int32’ for method

And basically this does not work either.

The only thing I can think of is create a crap load of separate action methods, and assign them to the controls dynamically based upon the index of my collection. This would be limited though, as now the methods would be limited to the amount I create.

you can’t get scheduler object from data method, because “Index” and “GetSchedulerData” are called by different requests(after initialization calendar sends ajax request to the data action), scheduler doesn’t exist when “GetSchedulerData” is called.
But you may load data right into scheduler,

public ActionResult Index() { var sched = new DHXScheduler(this); var dataCollection = getDataSomehow(); scheduler.Data.Parse( dataCollection); return View(sched); } in this case you should remove this line scheduler.LoadData = true;

The data is being populated/assigned to the scheduler, but looking in the rendering, I am seeing “scheduler_here” repeated in divs on every scheduler rendered. I am assuming this needs to be unique? If so, how do I set the id so I can make sure the divs are uniquely named?

Attached a pic to show what I am talking about.

currently only on scheduler on page is supported,
you may try to use iframes for multiple calendars