Okay
  Public Ticket #2100110
wpdatatables_after_frontent_edit_row( $formdata, $rowId, $tableId )
Closed

Comments

  • Mario Cantalupo started the conversation

    Salve,
    utilizzando il filtro

    wpdatatables_after_frontent_edit_row( $formdata, $rowId, $tableId )

    come posso recuperare tutti i dati della riga con $rowId?

  •  2,572
    Aleksandar replied

    Hello Mario.

    Thank you for your purchase.

    Please note that the only official support language is English, so please translate all further questions. We don't use Google Translate because a lot can be lost in the translation.

    Thank you for understanding.

    I believe you're trying to fetch the $rowId, correct?

    Please note that using hooks requires certain level of programming skills and included support refers only to advice.

    The wpdatatables_after_frontent_edit_row can be found in ../wp-content/plugins/wpdatatables/controllers/wdt_ajax_actions.php

    As is explained in documentation for this action:

    $formdata is the array of keys and values for editing

    Structure of this parameter depends on data in your table so you have to debug it and see what is returned in array of keys and values.

    You can create a custom PHP script that would tell if you if the code is firing when you configure it. One of our users called the function after the user made an update to the data in the table with this:

    add_action( 'wpdatatables_after_frontent_edit_row', 'updateSID', 10, 3 );
    function updateSID( $formdata, $rowId, $tableId ) { 
    exec("php /home/calljuggler/www/admin/d.php");
    }
         
    do_action ('wpdatatables_after_frontent_edit_row', $formdata = true, $rowId = true, $tableId = 1 );
    

    Where d.php is the custom script I was talking about. Eventually they got it working with:

    // dsr //
    function updateSID($formdata, $rowId, $tableId) { 
    if ($tableId == 1) {
    $lfile = '/home/calljuggler/www/admin/it-Ran.txt';
    $current = file_get_contents($lfile);
    $current .= $tableId; 
    file_put_contents($lfile, $current); 
    exec("/usr/local/bin/php /home/calljuggler/www/admin/d.php");
    } 
    }
    add_action( 'wpdatatables_after_frontent_edit_row', 'updateSID', 10, 3);
    // dsr //

    You can call the hook and have it write to a txt file. Then look at what was put out. You're probably looking for $formdata['column_name'] so you can set that as a variable from the array.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Mario Cantalupo replied

    Hi Aleksandar, 
    my question is: in which way I can retrieve data from the table using the $rowId?

    For example, if I have 5 columns and I edit value of one column, in this function i want retrieve the value of all column for the edited row.

    Thanks

  •  2,572
    Aleksandar replied

    Hi again Mario.

    As it is explained in documentation for this action:

    $formdata is the array of keys and values for editing, so when executed it will return the name of the column and the values of all columns within the edited row.

    Structure of this parameter depends on the data in your table, so you have to debug it and see what is returned in array of keys and values.

    Please note that using hooks requires certain level of programming skills and included support refers only to advice.

    Best regards.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables