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

Kendo UI Grid with PHP & MYSQL - Details Grid Wont Save

2 Answers 138 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 17 Aug 2016, 05:37 AM
This is my master grid

 

$(document).ready(function() {
    $("#grid").kendoGrid({
        height: 800,
        sortable: true,
        pageable: true,
        selectable: "row",
        filterable: {
            mode: "row"
        },
        editable: { //disables the deletion functionality
            update: false,
            destroy: false
        },
        scrollable: true,
        groupable: true,
        pageable: {
            pageSizes: [10, 25, 50, 100],
            refresh: true,
            buttonCount: 5

 

 

This is the subgrid, when I click the save button, it never make to the POST to the php script. Is there a bug I have to make a event for make the POST?

 

01.function detailInit(e) {
02.           // get a reference to the current row being initialized
03.           var detailRow = e.detailRow;
04. 
05.           detailRow.find(".subgrid").kendoGrid({
06.               dataSource: {
07.                   transport: {
08.                       read: "./data/getDetails.php",
09.                       update: {
10.                           url: "./data/getDetails.php",
11.                           type: "POST"
12.                        }
13.                   },
14.                   schema: {
15.                       data: "data"
16.                   },
17.                   serverFiltering: true,
18.                   filter: {field: "candidate_id", operator: "eq", value: e.data.candidate_id}
19.               },
20.               sortable: true,
21.               pageable: true,
22.               selectable: "row",
23.               height:300,
24.               pageable: {
25.                   pageSizes: 5,
26.                   refresh: true,
27.                   buttonCount: 5
28.               },
29. 
30.               //rowTemplate: kendo.template($("#rowTemplate").html()),
31.               columns: [
32. 
33.                   {title: "Task", field: "ARS",width: "100px",filterable: {
34.                       cell: {
35.                           showOperators: false
36.                       }
37.                   }},
38.                   {title: "Score", field: "Value",width: "250px"},
39.                   {  showOperators: false}
40.               ],
41.               detailInit: detailInit,
42.               editable: true,
43.               navigable: true,
44.               toolbar: [ "save", "cancel" ]
45. 
46.           });
47.       }
48. 
49.   });

 

 

Please advice, I had been working on it for a while, still havent figure out the details. To make this work.

 

Do I have to define the schema to fix the problem? But even without it , everything looks great

 

2 Answers, 1 is accepted

Sort by
0
Victor
Top achievements
Rank 1
answered on 17 Aug 2016, 09:35 AM

Just realize, my sub grid is row template

 

 

0
Daniel
Telerik team
answered on 19 Aug 2016, 07:20 AM
Hello,

Could you clarify what you mean by "my sub grid is row template"? Based on the code that you provided, the update action will not be called because the id field is not defined in the model:
dataSource: {
   ...
   schema: {
       data: "data",
       model: {
           id: "IdFieldName"
       }
   },
which is required in order for the editing to work.

Regards,
Daniel
Telerik by Progress
 
Get started with Kendo UI in days. Online training courses help you quickly implement components into your apps.
 
Tags
Grid
Asked by
Victor
Top achievements
Rank 1
Answers by
Victor
Top achievements
Rank 1
Daniel
Telerik team
Share this question
or