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

2 posts, 0 answers
  1. Ryan
    Ryan avatar
    1 posts
    Member since:
    Aug 2010

    Posted 11 Oct Link to this post

    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!
  2. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    347 posts

    Posted 13 Oct Link to this post

    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.
  3. Kendo UI is VS 2017 Ready
Back to Top