This is a migrated thread and some comments may be shown as answers.

Can't get delete to work

2 Answers 75 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
BRAD
Top achievements
Rank 1
BRAD asked on 22 Sep 2014, 03:14 PM
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 Answers, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 24 Sep 2014, 12:55 PM
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!
 
0
BRAD
Top achievements
Rank 1
answered on 24 Sep 2014, 03:37 PM
Test app and support ticket has been made and sent.
Tags
Gantt
Asked by
BRAD
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
BRAD
Top achievements
Rank 1
Share this question
or