Server side processing with extra html in columns
Server side processing with extra html in columns
How would I get the server side code to return html in with the database data
I'm working from the examples given on this site for server side processing
...
$columns = array(
array( 'db' => 'ID', 'dt' => 0 ),
array( 'db' => 'TestName', 'dt' => 1 ),
array( 'db' => 'Passed', 'dt' => 2 ),
array( 'db' => 'Failed', 'dt' => 3 ),
// Col 4 is a "notes" text area with default text from DB
// Col 5 is a save button which calls ajax with the ID value from col 0
);
...
Is there a way to implement column 4 and 5 as above?
This is a simplied example of what I'm doing, basically all my tables have a column which contains a graphical representation of some data, which is working great if I do all the data loading at page load, but that's starting to take over a minute so I want to use datatables' server side processing if possible.
Answers
I started from this example http://datatables.net/development/server-side/php_cake
Modified it to work with code igniter and MVC
This is the first working code I got to, could be cleaned up a bit.
View snippet
Controller snippet
JS Snippet
Model snippet