I need PHP COD for (Parent child editing in child row) i no understand in example Blog

I need PHP COD for (Parent child editing in child row) i no understand in example Blog

Nivaldo dos SantosNivaldo dos Santos Posts: 3Questions: 1Answers: 0

Hello My name is Nivaldo, and I live in Brazil.

I didn't understand the part in the blog that talks about how to create the php file and where to put it.
If you can give me the full structure of the files I would be grateful.

I need to create something like this!
https://datatables.net/blog/2019/parent-child-editing-in-child-rows

My name is Nivaldo, and I live in Brazil.
Many Thanks

Answers

  • rf1234rf1234 Posts: 2,988Questions: 87Answers: 421

    If you look at the site Editor on the client it has this "ajax" parameter:

    ajax: '../php/sites.php'
    

    All you need to to do is to create a php file called "sites.php" in your php directory on the server.

    The same applies to the parent table. In the example the "ajax" parameter is this:

    ajax: {
       url: '/media/blog/2016-03-25/users.php',
       type: 'post',
       data: function ( d ) {
           d.site = rowData.id;
       }
    }
    

    But you might as well change the path to this, for example, and create the file just like the one above.

    ajax: {
       url: '../php/users.php',
       type: 'post',
       data: function ( d ) {
           d.site = rowData.id;
       }
    }
    
  • allanallan Posts: 63,489Questions: 1Answers: 10,470 Site admin

    Also, all of the examples listed here are included in the Editor download package, including the parent / child example and all of its files.

    Allan

  • Nivaldo dos SantosNivaldo dos Santos Posts: 3Questions: 1Answers: 0

    Good morning "rf1234" and ALLAN, thank you very much for your immediate help. With your alerts I located the folder with the example files. Now I will study them and put the idea into practice.
    "Live long and prosper!"
    A hug from Brazil!
    Nivaldo.

  • Nivaldo dos SantosNivaldo dos Santos Posts: 3Questions: 1Answers: 0

    Hello friends. I need more help!
    I managed to get master detail working on my system. But I can't make the buttons appear!
    I didn't find the html file so I'm using the html from the other simple master detail example from the datatable. This could be the problem.
    If so, how do I get the correct html file?
    Thank you very much!
    Hugs.
    Nivaldo from Brazil.

  • kthorngrenkthorngren Posts: 21,319Questions: 26Answers: 4,948

    But I can't make the buttons appear!

    Which buttons? Are you referring to the editor button's for the parent or child or something else?

    Which parent/child solution are you trying to implement? There are two solutions linked in this thread.

    At a minimum post your relevant Javascript code with details of what exactly isn't working. Better is a test case replicating the issue so we can help debug.
    https://datatables.net/manual/tech-notes/10#How-to-provide-a-test-case

    Kevin

Sign In or Register to comment.