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

Initializing dropdownlist editor in custom popup window

2 Answers 247 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mantas
Top achievements
Rank 1
Mantas asked on 12 Oct 2016, 09:36 PM

Hi,

I needed batch edit and popup window at the same time. I just have a question - how is it possible to initialize editor for dropdownlist? Here a small sample: 

http://dojo.telerik.com/aSaXe/14

 

I'm doing this in dynamic way, because I want to wrap everything in function and reuse for more grids.

2 Answers, 1 is accepted

Sort by
0
Mantas
Top achievements
Rank 1
answered on 13 Oct 2016, 06:49 AM

I think I got this working. Previous code had a small bug. This one seems to be working:

http://dojo.telerik.com/aSaXe/15

 

Does this look like a proper way to manually initialize editor?

0
Dimiter Topalov
Telerik team
answered on 14 Oct 2016, 10:08 AM
Hello Mantas,

The recommended approach is to set the Grid's editing mode to "popup", and either define a custom editor template for the whole popup via the editor.template option, or a custom editor for the respective column, that has to be edited via the columns.editor option.

Also, the Grid's dataSource.transport should be configured for CRUD operations, as described in the following section of our documentation:

http://docs.telerik.com/kendo-ui/framework/datasource/crud

If you want to put a given row in edit mode on click instead of using the columns.command option, this can be done by attaching a custom click handler to the Grid's tbody, obtaining the clicked row, and call the editRow() method, e.g.:

...
var grid = $('#grid').data('kendoGrid');
grid.tbody.click(function(e){
  var row = $(e.target).closest('tr');
  grid.editRow(row);
});

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
Mantas
Top achievements
Rank 1
Answers by
Mantas
Top achievements
Rank 1
Dimiter Topalov
Telerik team
Share this question
or