Initializing dropdownlist editor in custom popup window

3 posts, 0 answers
  1. Mantas
    Mantas avatar
    4 posts
    Member since:
    Jul 2015

    Posted 12 Oct Link to this post

    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. Mantas
    Mantas avatar
    4 posts
    Member since:
    Jul 2015

    Posted 13 Oct Link to this post

    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?

  3. Kendo UI is VS 2017 Ready
  4. Dimiter Topalov
    Admin
    Dimiter Topalov avatar
    347 posts

    Posted 14 Oct Link to this post

    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.
Back to Top