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
![erandra](https://secure.gravatar.com/avatar/a514d7db326ccc41218cb59c23dd11fb/?default=https%3A%2F%2Fvanillicon.com%2Fa514d7db326ccc41218cb59c23dd11fb_200.png&rating=g&size=120)
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 ?>';
}
}
]
});
This discussion has been closed.
Answers
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
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.
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 isKPNO_TRANSAKSI
. You can use Javascript to for the condition.Kevin
This is my php code,
![](https://datatables.net/forums/uploads/editor/18/3g5r0s2md9ls.png)
this is my dataTable code
![](https://datatables.net/forums/uploads/editor/tb/hyfbupesjkv6.png)
i want make condition like on php code for button. and the condition get from database.
Please Help.
Thanks