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

Kendo Grid Custom Popup Dynamically Created

1 Answer 267 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 17 Apr 2016, 05:39 PM

Hi,

    Is it possible to create the custom popup editor dynamically?  I have a grid merging different objects would like like to change popup editor dynamically.  Usually, I used this form and it works fine:

editable: {
    mode: "popup",
    template: kendo.template($("#allRequestEditGridTemplate").html()),
    confirmation:"@Html.Raw(@LocString["STR_DeleteConfirmation"])",
},

However, I would like use something like this and it does not work.  I got correct template shown, but no update button....

edit: function (e) {
 
   var editWindow = this.editable.element.data("kendoWindow");
 
 
    if(e.model.CategoryType == 1 /*Document*/)
    {
            editWindow.content($("#docEditTemplate").html());
    }
    else if(e.model.CategoryType == 2 /*Piping*/)
    {
            editWindow.content($("#pipingEditTemplate").html());
    }
}

 

Thank you for your help

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 20 Apr 2016, 07:44 AM

Hello Steve,

Indeed this approach can cause some unexpected behavior. At this point (when edit event is fired) the content of the window already contains the update and cancel button and they are removed once you set new content. 

Maybe a possible solution in this case is to contain both of the templates and hide one of them in the edit event. 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Steve
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or