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

open window for edit from grid cell

2 Answers 8 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Help
Top achievements
Rank 1
Help asked on 09 May 2017, 10:11 PM

Hello,

I'm stumped, and could use some direction. If you can provide me a clue, I'd appreciate it.

In my app, I have a view containing a grid. Each row of the grid corresponds to a Job. Each Job has a Schedule, itself an object, as one of the Job's members.

So, from this grid in which each row corresponds to a Job, I need to be able to open a partial view in which to edit a Job's schedule. (In each row, I can edit the Job data members that are simple types. But to edit its Schedule, I need to open a partial view.)

I am aware that there is a Window control. That may be the appropriate mechanism for opening the partial view. There is the matter of passing the appropriate model object to the partial view, which would be the Job's Schedule.

Here's what the grid looks like, minus any column for the Schedule (I don't know what that looks like yet.)

 

@Html.Kendo().Grid(Model).Name("JobsRecurringGridEx").DataSource(d => d.Ajax()
        .Model(m =>
        {
            m.Id(o => o.ID);
            m.Field(o => o.ID).Editable(false);
        })
        .Batch(true)
        .Read(r => r.Action("GetJobsRecurringAll", "JobsRecurring"))
        .Update(r => r.Action("UpdateJobsRecurring", "JobsRecurring"))
        .Create(r => r.Action("AddJobsRecurring", "JobsRecurring"))
        ).Columns(col =>
        {
            col.Bound(o => o.ID);
            col.Bound(o => o.JOB_NAME).EditorTemplateName("String");
            col.Bound(o => o.DBID).EditorTemplateName("String");

            col.Bound(o => o.PARAMETER_1).Hidden(true).EditorTemplateName("String");
            col.Bound(o => o.PARAMETER_2).Hidden(true).EditorTemplateName("String");
            col.Bound(o => o.PARAMETER_3).Hidden(true).EditorTemplateName("String");
            col.Bound(o => o.PARAMETER_4).Hidden(true).EditorTemplateName("String");
            col.Bound(o => o.PARAMETER_5).Hidden(true).EditorTemplateName("String");
            col.Bound(o => o.PARAMETER_6).Hidden(true).EditorTemplateName("String");
            col.Bound(o => o.PARAMETER_7).Hidden(true).EditorTemplateName("String");
            col.Bound(o => o.PARAMETER_8).Hidden(true).EditorTemplateName("String");
            col.Bound(o => o.PARAMETER_9).Hidden(true).EditorTemplateName("String");
            col.Bound(o => o.PARAMETER_10).Hidden(true).EditorTemplateName("String");

            col.Bound(o => o.START_RUN_DATE_TIME);
            col.Bound(o => o.LAST_RUN_DATE_TIME);
            col.Bound(o => o.NEXT_RUN_DATE_TIME).EditorTemplateName("DateTime");
            col.Bound(o => o.SEED_RUN_DATE_TIME).EditorTemplateName("DateTime");

            col.Bound(o => o.RUN_INTERVAL).EditorTemplateName("Integer");
            col.Bound(o => o.ACTIVE);
            col.Bound(o => o.PAUSED).Hidden(true);
            col.Bound(o => o.CREATED_BY).Hidden(true).EditorTemplateName("String"); ;
            col.Bound(o => o.CREATED_DATE_TIME).Hidden(true).EditorTemplateName("DateTime");
         
        }).Editable(e => e.Mode(GridEditMode.InCell)).ToolBar(tb => { tb.Create(); tb.Save(); }).Sortable().Filterable().Pageable()

 

The partial view that I need to use in order to edit a Job's Schedule is "~/Views/JobSchedule/_Index.cshtml".

 

 

 

 

 

 

2 Answers, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 11 May 2017, 12:56 PM
Hello,

You could use the ID field of the dataItem and pass it as a query string to the PartialView, where you could add the corresponding item to the Model. You could refer to the following forum thread for some ideas:

Regards,
Konstantin Dikov
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Help
Top achievements
Rank 1
answered on 11 May 2017, 05:57 PM
Thanks, I appreciate your help. I was just seeking a clue.
Tags
Grid
Asked by
Help
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Help
Top achievements
Rank 1
Share this question
or