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

Change editor template at runtime

3 Answers 300 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gregory
Top achievements
Rank 1
Gregory asked on 30 Mar 2017, 04:10 PM

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);

3 Answers, 1 is accepted

Sort by
0
Gregory
Top achievements
Rank 1
answered on 30 Mar 2017, 05:58 PM

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).

 

 

0
Viktor Tachev
Telerik team
answered on 03 Apr 2017, 11:14 AM
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.
0
Gregory
Top achievements
Rank 1
answered on 03 Apr 2017, 10:35 PM

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

Tags
Grid
Asked by
Gregory
Top achievements
Rank 1
Answers by
Gregory
Top achievements
Rank 1
Viktor Tachev
Telerik team
Share this question
or