edit event of Child Grid

2 posts, 0 answers
  1. Rajaraman
    Rajaraman avatar
    3 posts
    Member since:
    May 2015

    Posted 03 Jun 2016 Link to this post

    In a master child Kendo Grid in the child grid that's been configured for edit/create/celete how do we know if are editing or creating ? For a single level grid we can handle it this way and set the window title. 

    edit: function(e) {

        if (!e.model.isNew()) {
                  $(".k-window-title").text("Edit ");
                    
          // Disable the editor of the "id" column when editing data items
          var numeric = e.container.find("input[name=id]").data("kendoNumericTextBox");
          numeric.enable(false);
        }
        else{
          $(".k-window-title").text("Create");

        }

    How do we do the same in a child grid ? ( http://demos.telerik.com/kendo-ui/grid/hierarchy ) . Here 

    $("<div/>").appendTo(e.detailCell).kendoGrid({ 

  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    2062 posts

    Posted 06 Jun 2016 Link to this post

    Hello Rajaraman,

    I already replied in your support ticket, but I will post my reply here if it will be useful for someone else. 

    Since the child grid is initialized as completely separate widget from the master grid the same approach can be used. You can subscribe for the edit event and execute the deisred logic in the handler. Please refer to the http://dojo.telerik.com/EfUVe example. The "ShipCountry" value is printed to the console, when a record from the child grid is opened for edit. 

    Regards,
    Boyan Dimitrov
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top