Can't get delete to work

3 posts, 0 answers
  1. BRAD
    BRAD avatar
    27 posts
    Member since:
    May 2012

    Posted 22 Sep 2014 Link to this post

    I'm using the new GANTT form, and while i have read/create/update working fine, the delete doesn't work at all.  I'm using MVC, and it's not even reaching my controller, i get a 'Uncaught TypeError: undefined is not a function'.  Clicking on the source of that error in google chrome, i just get the following script:
    (function(d, __f, __o
    /**/) {
    return ((d.successorId || '').toLowerCase() == '60ae635d-4d7e-490b-9433-0a691adc0a03')
    })

    I am using GUIDs as my Model ID instead of integers.  If it helps, here is my GANTT cshtml:
    @(Html.Kendo().Gantt<CoBRAMVC4Portal.Areas.Admin.Models.OpPeriodTaskViewModel, CoBRAMVC4Portal.Areas.Admin.Models.OpPeriodDependencyViewModel>()
        .Name("Gantt")
            .Columns(columns =>
                {
                    columns.Bound("title").Editable(true).Sortable(true);
                    columns.Bound("start").Title("Start Time").Format("{0:G}").Editable(true).Sortable(true);
                    columns.Bound("end").Title("End Time").Format("{0:G}").Editable(true).Sortable(true);
                })
                .Views(views =>
                {
                    views.DayView();
                    views.WeekView(weekView => weekView.Selected(true));
                    views.MonthView();
                })
                    .ShowWorkHours(false)
                .ShowWorkDays(false)
                .Snap(false).Selectable(true).Navigatable(false)
        .DataSource(ds => ds
            .Read(read => read
                    .Action("_GetOpPeriods", "ProjectAdmin", new { area = "Admin", id = ViewContext.RouteData.Values["id"].ToString() })
            )
            .Model(m =>
            {
                m.Id(f => f.TaskID);
                m.ParentId(f => f.ParentID);
                m.OrderId(f => f.OrderId);
                m.Field(f => f.Expanded).DefaultValue(true);
            })
            .Destroy(destroy => destroy.Action("_DeleteOpPeriod", "ProjectAdmin", new { area = "Admin", id = ViewContext.RouteData.Values["id"].ToString() }).Type(HttpVerbs.Post))
                        .Update(update => update.Action("_UpdateOpPeriod", "ProjectAdmin", new { area = "Admin", id = ViewContext.RouteData.Values["id"].ToString() }).Type(HttpVerbs.Post))
                    .Create(create => create.Action("_AddOpPeriod", "ProjectAdmin", new { area = "Admin", id = ViewContext.RouteData.Values["id"].ToString() }).Type(HttpVerbs.Post))
        )
        .DependenciesDataSource(ds => ds
            .Read(read => read
                            .Action("_GetDependencies", "ProjectAdmin", new { area = "Admin", id = ViewContext.RouteData.Values["id"].ToString() })
            )
            .Model(m =>
            {
                m.Id(f => f.DependencyID);
                m.PredecessorId(f => f.PredecessorID);
                m.SuccessorId(f => f.SuccessorID);
                m.Type(f => f.Type);
            })
        )
    )

    and here is my controller code:
    [AcceptVerbs(HttpVerbs.Post)]
            [CoBRAMVC4Portal.CustomProviders.CustomAuthorize(Roles = "OrgAdmin,SysAdmin,NormalUser")]
            public ActionResult _DeleteOpPeriod([DataSourceRequest] DataSourceRequest request, OpPeriodTaskViewModel item, Guid id)
            {
                if ((item != null) && (item.TaskID != Guid.Empty))
                {
                    WebEngine.RemoveOperationalPeriod(CoBRAMVC4Portal.App_Start.StructuremapMvc.StructureMapDependencyScope.Container.GetInstance<DGI.CoBRAPlugInSDK.IDatabaseMethods>("Log"), item.TaskID);
                }
                return Json(ModelState.ToDataSourceResult(request,ModelState ), JsonRequestBehavior.DenyGet);
            }


    any help would be appreciated!
  2. Bozhidar
    Admin
    Bozhidar avatar
    1101 posts

    Posted 24 Sep 2014 Link to this post

    Hello,

    Could you open a support ticket and attach a fully runnable sample project, so that we can inspect the issue more closely?

    Regards,
    Bozhidar
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. BRAD
    BRAD avatar
    27 posts
    Member since:
    May 2012

    Posted 24 Sep 2014 in reply to Bozhidar Link to this post

    Test app and support ticket has been made and sent.
Back to Top