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

Custom PopUp Editor - Perform Action and Remain Open?

4 Answers 172 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 31 May 2013, 03:28 PM
This is partially a Kendo Grid question and I think partially a general MVC question.

I have a Grid and I am using a custom popup editor template.  Within that template I have one field (from the grid) which is for EmployeeID.  While the editor window is open I want them to enter the EmployeeID and have it do a lookup and get the employee name for that ID and display it so they can make sure it is correct before they submit.

I'm not really sure how to go about doing that.  Any advice or examples would be greatly appreciated.

Thanks,

Steve

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 04 Jun 2013, 03:38 PM
Hello Steve,

You could use the approach demonstrated in this code library to prevent the popup from closing when there are invalid values. For the scenario that you described, you could also use a dropdownlist to ensure that the user has selected a correct value.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Stephen
Top achievements
Rank 1
answered on 06 Jun 2013, 03:16 PM
I see what that example is showing using the validation but I guess my question is even higher level than that because I am looking to do some processing within the grid popup editor that is not validation.

I am new to MVC but I have done this in .Net Forms using Telerik RadGrid with no problem and I'm just not sure how to go about it here.

For example, in .Net Forms within a RadGrid if I had some fields within the EditForm Template that I wanted to process without submitting the EditForm back to the grid I would just put the control in there with an autopostback, handle it in the codebehind, and display the necessary info back in the EditForm.  Then at that point they could submit the form.

In the case of MVC though I'm not sure not only how to keep the popup editor open but if I add fields to the custom EditorTemplate, how do I hook those to a method in the Controller that is not the Add/Update method?  And if I do that will it process and return to the grid popup editor?

What I create another view to do the lookup and add that into the EditorTemplate as a partial view or something?  If so, how would I do that?
0
Daniel
Telerik team
answered on 10 Jun 2013, 08:45 AM
Hello Steve,

From the description it seems that you should use remote validation which is currently not supported. In order to make a request to a custom action and prevent the form from being submitted during the request, I can suggest to create a custom validation rule as demonstrated in the "Custom validator editing" demo from the offline examples project and make a synchronous request by using the async option.

Regards,
Daniel
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Accepted
Stephen
Top achievements
Rank 1
answered on 18 Jul 2013, 01:45 PM
Just wanted to close this out and say that I accomplished it using partial views loaded into an editor template and within the partial view I used jquery to make a call to a controller to do the initial lookup and then submit the editor back to the grid the usual way.

Thanks.
Tags
Grid
Asked by
Stephen
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or