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

3 posts, 0 answers
  1. Victor
    Victor avatar
    4 posts
    Member since:
    Sep 2015

    Posted 17 Aug Link to this post

    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. Victor
    Victor avatar
    4 posts
    Member since:
    Sep 2015

    Posted 17 Aug in reply to Victor Link to this post

    Just realize, my sub grid is row template

     

     

  3. Kendo UI is VS 2017 Ready
  4. Daniel
    Admin
    Daniel avatar
    2118 posts

    Posted 19 Aug Link to this post

    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.
     
Back to Top