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: 2Questions: 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,951Questions: 87Answers: 416

    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,262Questions: 1Answers: 10,424 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: 2Questions: 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.

Sign In or Register to comment.