how to get value from array columns data on Datatable to variable on php

how to get value from array columns data on Datatable to variable on php

erandraerandra Posts: 5Questions: 1Answers: 0

how get value data to variabel test in php?

{
            'data': 'KPNO_TRANSAKSI',
            'className': "center",
            'render': function (data){
              '<?php $test ?>' = data; // i want get value data to variabel test
              return '<?php echo $test ?>';
            }
          }                 
      ]
    });

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    It looks like you are mixing PHP and Javascript there. There PHP will only run at the server-side - not the client-side.

    To be honest I'm not sure what you are actually trying to achieve with that code. Could you explain it to me please?

    Thanks,
    Allan

  • erandraerandra Posts: 5Questions: 1Answers: 0

    yes, i try to mixing.
    i want make some button
    i just want get value from KPNO_TRANSAKSI for make condition to decide btn-success or btn-danger. so, how can i do it if i'm not mixing it.

  • kthorngrenkthorngren Posts: 21,330Questions: 26Answers: 4,951

    Here is an example for using columns.render to build buttons.
    http://live.datatables.net/qemodapi/1/edit

    The data parameter will have the column value which is KPNO_TRANSAKSI. You can use Javascript to for the condition.

    Kevin

  • erandraerandra Posts: 5Questions: 1Answers: 0

    This is my php code,

    this is my dataTable code

    i want make condition like on php code for button. and the condition get from database.
    Please Help.

    Thanks

This discussion has been closed.