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

Need Help regarding Kendo Detailed Editable grid

1 Answer 385 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nagaraju
Top achievements
Rank 1
Nagaraju asked on 11 May 2016, 07:19 PM
Hi,
  I am working on Detailed editable grid in which,
  Parent Grid shows the summary data and the child grid shows the detailed rows.
  At the starting, I am using some filters in which whenever "submit" button clicked, then the parent grid is loaded.
  and I am implementing the "detailExpand" to read the data from the servlet with the parameters from the parent grid.
  I have 2 Issues:
  Issue 1:
  --------
      Whenever "Submit" button is clicked, The parent grid is showing all the rows for a while, and then showing the actual filtered rows.
     And I see "SubmitController" is called twice. One without any parameters and the other with the selected "CostCenter,Team,Location" fields.

     And I am getting the same behaviour whenever I expand the parent row.

  Issue 2:
  --------
   whenever Edit/"Create New" is clicked in child grid, I need to populate the Child grid column "employeeID" with the same field from parent and want to make it as non-editable.

  I am attaching the jsp file and the ServletController.

Can you please help. 




Regards,
Nagaraju.V

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 13 May 2016, 04:14 PM

Hello Nagaraju,

Straight to your questions: 

   1. By default the Kendo UI Grid reads its data (makes a request to its read url) when the widget is initialized. This behavior is controlled by the autoBind property, which by default is set to true. So basically in your case the grids reads its data (default behavior) and immidiately after that a second request is made to filter. My suggestion is simply to set the autoBind property to false in order to avoid the initial request to load its entire data. 

  2. It is possible to access the master row (of parent grid) in the edit event of the child grid. This way one of the fields of the data item (child grid) can be set to a value extracted from the master row data item. Please refer to the http://dojo.telerik.com/evarE for a live demonstration of this approach. 

edit: function(e) {
    var parentRow = this.wrapper.closest("tr").prev();
     var masterRow = $("#grid").data().kendoGrid.dataItem(parentRow); 
        //just for testing purpose the field "ShipCountry" of the child data item is           //set to the EmployeeID of the master data item
     e.model.set("ShipCountry", masterRow.EmployeeID);
   },

 

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
Nagaraju
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or