kendo child grid, dropdown list not rendering properly

6 posts, 0 answers
  1. Lijo
    Lijo avatar
    4 posts
    Member since:
    Jul 2018

    Posted 23 Jul 2019 Link to this post

     

    I am using editor template for child grid column. It is rendering for the first child grid. Like seeing in attached picture it is not rendering for the second  child grid.

     

     columns.Bound(p => p.RoleId).EditorTemplateName("UserRole").Title(ViewBag.Location).ClientTemplate("\\#:RoleName\\#"); 

  2. Georgi
    Admin
    Georgi avatar
    685 posts

    Posted 25 Jul 2019 Link to this post

    Hello Lijo,

    The described behavior is expected as the child grids have the same configuration, thus their editor names are the same. In other words, it is not possible to have two rows opened in edit mode simultaneously. A possible workaround would be to exit edit mode in all child grids before editing.

    e.g.

    // attach BeforeEdit event handler
     
    .Events(x=> x.BeforeEdit("beforeEdit"))
     
    // beforeEdit event handler
     
            function beforeEdit(e){
                  $('#grid').find('.k-grid').each(function(){ // where `grid` is the name of the parent grid
                    if(!$.contains($(this), e.container)){
                      $(this).data('kendoGrid').cancelRow();
                    }
                  })
                }


    Regards,
    Georgi
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Lijo
    Lijo avatar
    4 posts
    Member since:
    Jul 2018

    Posted 26 Jul 2019 in reply to Georgi Link to this post

     

    Thanks for the work around.

     

    You cannot say the behavior is expected. Accept it as a bug. 

     

  4. Georgi
    Admin
    Georgi avatar
    685 posts

    Posted 29 Jul 2019 Link to this post

    Hi Lijo,

    The MVC wrappers basically generate some HTML and a initialization script which creates a jQuery widget. You can find further information regarding the server wrappers in the following article:


    Please note that the name of the wrapper is then used as an id to the element which the initialization script uses to create the widget. In the context of a hierarchy grid, all child grids are basically different instances of the same grid, thus the names of the editor widgets are the same. Therefore, if you have 2 grids in edit mode, the DOM will contain few elements with the same ids - which is invalid as the id selector will always return the first occurrence and the editors within the other rows will not initialize.


    Regards,
    Georgi
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  5. Lijo
    Lijo avatar
    4 posts
    Member since:
    Jul 2018

    Posted 29 Jul 2019 in reply to Georgi Link to this post

    Yes, that is a bug as per your design.

    Well, kendo allowing edit functionality on child grid. Also editor template option ( Drop down list)

    Then it is your responsibility to work properly. Client is laughing at me. QA team won't pass it. I cannot say editing one grid at a time is allowed. 

     

  6. Georgi
    Admin
    Georgi avatar
    685 posts

    Posted 31 Jul 2019 Link to this post

    Hello Lijo,

    The `hierarchical grid` is basically a standard grid with a detail template which contains another grid. The parent grid is not aware of those child grids, neither is the child grid aware of the parent grid. In other words the instances of those grids are not related in anyway and such limitations might occur. We will violate the separation of concerns principle if we include logic within our grid which checks whether there are any other grids surrounding it. In other words, the `hierarchical grid` is not a single component for displaying hierarchical data but a standard grid with detail template.

    For displaying hierarchical data, we provide the TreeList component. You can test it in the following demo:



    Regards,
    Georgi
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top