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

Customer Editor

2 Answers 32 Views
Form
This is a migrated thread and some comments may be shown as answers.
Jeffrey
Top achievements
Rank 1
Veteran
Jeffrey asked on 09 Feb 2021, 03:04 PM

Hello

I'd like to make a custom editor for the Form.  I would like to have a button and a read-only textbox.  The button trigger a method that opens a dialog containing a list of items.  The item(s) are selected and the data is returned back to the form and placed i the text box.

 

Is this possible?  Any chance there are more examples of custom editors?

 

Thank you

Jeff

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Neli
Telerik team
answered on 11 Feb 2021, 11:55 AM

Hi Jeffrey,

I would suggest you use the items.editor option or buttonsTemplate in order to add the custom button.

 buttonsTemplate:'<div class="k-form-buttons"><button class="k-button k-primary k-form-submit" type="submit">Submit</button><button class="k-button k-form-clear">Clear</button><button id="btn" class="k-button">Custom button</button></div>',

When the button is clicked, you could open a Kendo Window.  When the Window is closed, in the close event handler, you could retrieve the entered information and change the values in the From. 

 $("#btn").kendoButton({
        click: function(e){
          e.preventDefault()
          $("#window").data("kendoWindow").open();
        }
      });
      
      $("#window").kendoWindow({
        width: "600px",
        title: "About Alvar Aalto",
        visible: false,
        close: function(){
          	$("#Address").val($("#address-wnd").val())
        }
      })

Here is a Dojo example where the described is implemented.

I hope the provided suggestion suits your scenario. I remain at your disposal for any further questions regarding the issue.

 

Regards,
Neli
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Jeffrey
Top achievements
Rank 1
Veteran
answered on 12 Feb 2021, 04:32 AM

Perfect. 

Thank you,

Jeff

Tags
Form
Asked by
Jeffrey
Top achievements
Rank 1
Veteran
Answers by
Neli
Telerik team
Jeffrey
Top achievements
Rank 1
Veteran
Share this question
or