Change editor template at runtime

4 posts, 0 answers
  1. Gregory
    Gregory avatar
    27 posts
    Member since:
    Feb 2014

    Posted 30 Mar Link to this post

    Anyone know if there is a way to set the editor template of a grid at runtime? I'm trying to change the editing mode dynamically. e.g. from inline to popup and it seems to work fine, but it seems to clear my popup editor template. Here is an example of what I'm trying to do.

     

        grid.options.editable.mode = "popup";
        grid.options.editable.template = How can I set this at runtime?
        grid.editRow(row);

  2. Gregory
    Gregory avatar
    27 posts
    Member since:
    Feb 2014

    Posted 30 Mar Link to this post

    After more thought, I'm thinking that since my template is an MVC editor template it's rendered on the server and can't be rendered via javascript? I hope that's not the case. Any one have suggestions?  At this point I'm thinking of permanently setting the grid to inline edit. Then I would make a new editor page that isn't an editor template, but just gets the model and does the CRUD manually (not bound to the grid).

     

     

  3. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1784 posts

    Posted 03 Apr Link to this post

    Hi Gregory,

    I am afraid that the behavior you describe is not available out of the box. The edit mode for the Grid is set when the widget is initialized. Nevertheless, you can have similar behavior with a bit of additional code. 

    You can set the Grid to use Inline edit mode initially. Then, you can add a custom command button that would open a window that you can customize based on your requirements.



    Regards,
    Viktor Tachev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  4. Gregory
    Gregory avatar
    27 posts
    Member since:
    Feb 2014

    Posted 03 Apr Link to this post

    Thank you! I already started working on that idea :)

Back to Top