Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the value of some column and use in formater of another column #9

Closed
noveweb opened this issue Jun 2, 2016 · 2 comments
Closed

Comments

@noveweb
Copy link

noveweb commented Jun 2, 2016

Hi, guy!

How can i get the value of some column and use in formater of another column?

Thanks!

$columns = array(
array( 'db' => 'nome', 'dt' => 0 ),
array( 'db' => 'email', 'dt' => 1 ),
array(
'db' => 'timestamp',
'dt' => 2,
'formatter' => function( $d, $row ) {
return date('d/m/Y H:i', $d);
}
),
array(
'db' => 'ultimo_acesso',
'dt' => 3,
'formatter' => function( $d, $row ) {
return date('d/m/Y H:i', $d);
}
),
array(
'db' => 'id',
'dt' => 4,
'formatter' => function( $d, $row ) {

I WANT USE HERE THE VALUE FROM COLUMN "email"

        return "<a href='usuarios/administradores/editar/".$d."/' class='btn btn-xs btn-primary'><i class='fa fa-pencil'></i></a> <a id='administradores_".$d."' href='javascript:;' class='btn btn-xs btn-danger del'><i class='fa fa-trash'></i></a>";
    }
)

);

@emran
Copy link
Owner

emran commented Jun 5, 2016

Within $row array param you have all the value of the present row.
So you just get those value via their indexes.

Like you can get value of Email from $row[1] as email field index is 1.

Cheers!! 👍

@emran emran closed this as completed Jun 6, 2016
@noveweb
Copy link
Author

noveweb commented Jun 10, 2016

Thank you, guy!!!

2016-06-06 2:43 GMT-03:00 Md. Emran ul hadi notifications@github.com:

Closed #9 #9.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#9 (comment), or mute the
thread
https://github.com/notifications/unsubscribe/AKrvVVoRTZPbp7Nl8daF1wDCz--Xu--Mks5qI7NrgaJpZM4ItEB7
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants