Events - I can't get the field value from the client part in the PHP code

Events - I can't get the field value from the client part in the PHP code

ostmalostmal Posts: 102Questions: 33Answers: 0
edited June 2021 in Free community support

Good evening!
I've been suffering all day today and I can't figure out what I'm doing wrong.
I would like to do this in PHP code: when changing a string, write the value of another field to a certain field.
It's written here:
https://editor.datatables.net/manual/php/events
And here:
https://datatables.net/blog/2015-10-02
Write a fixed value-it turns out. But I can't write the value of the field – the system swears!
JS:

{
"data": "crm_kandidat.tel"
},
{
"data": "crm_kandidat.note"
},

Works with this PHP code:

->on ('preEdit', function ( $e, $id, $values ) {
            $e - >field ('crm_kandidat. note')- >setValue( '99999' );
    } )

It doesn't work like this:

- >on ('preEdit', function ( $e, $id, $values ) {
            $e - >field ('crm_kandidat. note')- >setValue( $values['crm_kandidat.tel'] );
    } )

In the console, writes:
<b>Note< / b>: Undefined index: crm_kandidat.tel in ..........

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,230Questions: 1Answers: 10,417 Site admin
    Answer ✓

    Use:

    $values['crm_kandidat']['tel']
    

    it is submitted and parses as a 2D array.

    Allan

  • ostmalostmal Posts: 102Questions: 33Answers: 0

    Thank you so much for all your help!

Sign In or Register to comment.