Closed fr0z3nfyr closed 9 years ago
So you tried the string 'View'
for that column and still nothing? Setting it to null
is correct, it tells the plugin that column isn't tied to the database. You would need to generate the content you need it.
Didn't see that you had $actions
defined outside the loop. You probably need it in the loop, but the code as is should output the link.
autoRender
and autoData
are enabled by default. autoData
will extract the columns for you, and you can set autoRender
to false for further processing (like Actions column).
You can set autoData and autoRender both to false and use what you have as it is now, or just set autoRender to false and use the view file like this:
<?php
foreach ($dtResults as $i => $result) {
$this->dtResponse['aaData'][$i][INDEX_OF_ACTION_COLUMN] = 'Action yo ';
}
Excellent!! I tried the second solution and it worked perfectly in first attempt... I understand why you $actions
should have been inside foreach()
, corrected that. Thanks for help..
No problem.
I have followed the documentation(and few solutions in issues) instruction by instruction and am able to get the data correctly (of course, except the issue mentioned in #64). Now when I tried to add options to the last column of table, the column is created by config in
components
but the correspondingtd
in dataTable rows are always blank: Sample from Controller:datatable/myModel.ctp:
Is it possible that the issue is due to
'Actions' => null,
in config(should it be something else other thannull
)? How can this be fixed?