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

edit event of Child Grid

1 Answer 276 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rajaraman
Top achievements
Rank 1
Rajaraman asked on 03 Jun 2016, 01:01 PM

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({ 

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 06 Jun 2016, 12:58 PM

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!
 
Tags
Grid
Asked by
Rajaraman
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or