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

Changing the input control type in the edit template, but keeping binding.

1 Answer 225 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 11 Oct 2016, 01:32 PM
I've got a Kendo Grid that has an editor template with about 4 fields.  2 of those fields work together in that depending on the first field's value, I need to change the second <input> to be a calendar control, dropdownlist, etc.  This seems to work once if I leave a blank <input> and then in Javascript just do a $(#mycontrol).calendar() or equivalent to flip to a different type.  It seems, though, that there's not a way to easily tell an input to remove the calendar control portion and just go back to a regular input so that it can be changed to another type, without removing it entirely and adding another one, which breaks the binding back to the grid.  Does anyone have a suggestion or pointer for the best way to do this in Kendo?  Thanks!

1 Answer, 1 is accepted

Sort by
0
Dimiter Topalov
Telerik team
answered on 13 Oct 2016, 06:55 AM
Hi Ryan,

The described scenario is not supported, but a possible workaround is to destroy the widget via its destroy() method, and overcome the broken binding by manually handling the change event of the input, and call the model.set() method to set the input's value to the respective field.

I hope this helps.

Regards,
Dimiter Topalov
Telerik by Progress
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Share this question
or