I am confused which plugin I should use with datatable jquery. My problem is I cannot find any answer that solve all my problems (I have suffered more than 4 hours now). Sorry if this problem has been already addressed countless times...
I have a table with >10000 rows from a mysql database, I wanna add a cell Inline editing on a specific column and so I found two existing methods.
- http://datatables.net/examples/api/editable.html
- http://jquery-datatables-editable.googlecode.com/svn/trunk/inline-edit.html
My question is what are the differences ? Which one requires which js scripts as inputs (I got confused and added all of them at the end)... I have the feeling that some are outdated and doesn't work anymore with the most recent versions. Or maybe I am mixing both of them, so nothing works at the end.
Jeditable (it doesn't work in my hand. when I click on any cell in the table, nothing happens)
$("#example.", oTable.fnGetNodes()).editable( 'php/editable_ajax.php', {
"callback": function( sValue, y ) {
var aPos = oTable.fnGetPosition( this );
oTable.fnUpdate( sValue, aPos[0], aPos[1] );
},
"submitdata": function ( value, settings ) {
return {
"row_id": this.parentNode.getAttribute('id'),
"column": oTable.fnGetPosition( this )[2]
};
},
"height": "14px"
});
Editable (When I click, editing event works, but the value is not updated in the database, except if editable_ajax.php contains full mysql query, but then the page is not reloaded)
$('#example').dataTable().makeEditable({
sUpdateURL: "php/editable_ajax.php",
"aoColumns": [
null,
{
indicator: 'Saving CSS Grade...',
tooltip: 'Click to select CSS Grade',
loadtext: 'loading...',
type: 'select',
onblur: 'submit',
data: "{'':'Please select...', '1':'Yes','0':'No'}"
}
]
});
PHP server side
<?php
echo $_POST['value'].' (server updated)';
?>
One last question, is there one of them that handles more efficiently datatable with lots of row ? (it takes already 30 sec to load it).