unitsview ad weekview

I use unitsview, weekview and decadeview *customized to shw 30days).
I face problem in loading events from database, when i load events from database ,eventbox gets loaded in the first column of unitsview and it same happens in weekview and monthview.
hereis myscreenshot of unitsview attached.
I use customized eventbox to render events.

[code] public ActionResult Index()
{
var scheduler = new DHXScheduler();
ViewBag.scheduler = scheduler;
scheduler.LoadData = true;
scheduler.EnableDataprocessor = true;
scheduler.Views.Add(new DecadeView()
{
Label = “Decade”
});
scheduler.Config.hour_date = “%h:%i%A”;
scheduler.Config.xml_date = “%d/%m/%Y %H:%i”;

        scheduler.BeforeInit.Add("customeventbox()");
        scheduler.BeforeInit.Add("configureScales()");
        var evBox = new DHXEventTemplate();
        scheduler.XY.min_event_height = 1;
        scheduler.Config.day_date = "%l </br> %d %F";
        scheduler.Extensions.Add(SchedulerExtensions.Extension.ContainerAutoresize);
        scheduler.InitialDate = DateTime.Today;
        scheduler.Config.start_on_monday = true;
        scheduler.Config.drag_create = false;
        scheduler.Skin = DHXScheduler.Skins.Standart;
        scheduler.Config.week_date = "%j %D";
        scheduler.Config.mark_now = false;
        var unit = new UnitsView("units", "ID");
        scheduler.Views.Add(unit);
        List<GetResourceOrderDisplay_Result> resourcedisplayname = new List<GetResourceOrderDisplay_Result>();
        resourcedisplayname = _scheduler.Getresorderdisplay();
 
        var options = new List<object>();
        unit.AddOptions(resourcedisplayname.Select(u => new { key = u.ID, label = u.DisplayName }));
        scheduler.InitialView = "units";
            scheduler.DataAction = Url.Action("Data", "Scheduler");
        return View(scheduler);
    #endregion
    }[/code]

public ContentResult Data() { var scheduler = new DHXScheduler(); scheduler.InitialDate= DateTime.Today ; var data = new SchedulerAjaxData(new Entities().GetAppDisplay(scheduler.InitialDate).Select(e => new { id = e.ID, e.ResourceID, start_date = e.StartTime, end_date = e.Duration, e.Color, text = "" })); data.DateFormat = "%d/%m/%Y %H:%i"; return data; }

[code]function customeventbox() {
//customevenbox
scheduler.attachEvent(“onTemplatesReady”, function () {
scheduler.templates.event_header = function (start, end, ev) {
return scheduler.templates.event_date(ev.start_date) + "- " +
scheduler.templates.event_date(ev.end_date)
}
scheduler.templates.event_text = function (start, end, ev) {
return “” + ev.Color + “
” + ev.ResourceID + “”;
}
});
//decadeview
scheduler.attachEvent(“onTemplatesReady”, function () {
scheduler.date.decade_start = function (date) {
var ndate = new Date(date.valueOf());
ndate.setDate(Math.floor(date.getDate() / 10) * 10 + 1);
return this.date_part(ndate);
}
SetTiming();
scheduler.templates.decade_date = scheduler.templates.week_date;
scheduler.templates.decade_scale_date = scheduler.templates.week_scale_date;
scheduler.date.add_decade = function (date, inc) {
return scheduler.date.add(date, inc * 30, “day”);
}

});

}[/code]


I have the unitsview working now, i din assign the property in the SchedulerajaxData.
Please help me out in Filter issue.



This is my weekview after rendering the events from schedulerajaxdata.even 10 am events are loading at 8am clock.I doubt this might get solved after filtering events in weekview.

Now i need to filter the weekview.
I have five inputs (units view names) inside a listbox.
I got all the datas(events) loaded to the scheduler.
This is the output before applying the filter_week.
i got struck in calling scheduler.filter_week without calling it from the controller.
I got the resourceId from the listbox on clickevent now I need to pass this into the scheduler_filterweek
But i couldnt access scheduler.filter_week inside the function that is calling from listboxclick.
Please help.

Hers is my code:
index.cshtml:

[code]//#resourcename is my listbox id
$(‘#resourcename’).bind(“click”, function () {
debugger;
var resid = document.getElementById(‘resourcename’);

    var id = resid.options[resid.selectedIndex].value;
   
    filterweek(id);
    alert("listbox"+id); //here i get the resourceId correctly

});

function filterweek(id) {
alert(id);//here i get the alert id
scheduler.filter_week = function (id, event) {
alert(“you are in”);//this is not geting hit
alert(event.unitID);
if (event.unitID == 14) //tried to check to filter events with unitID ‘14’, where unitID is the propertyname of unitsview
return false; // event will be filtered (not rendered)
//or
return true; // event will be rendered
}

}[/code]

Question 2:

I use a totally external window instead of lightbox.I need the cancel button of that window to do the function of cancel button inside the lightbox. Please help.