datatable + add row + jeditable
datatable + add row + jeditable
madmike
Posts: 30Questions: 4Answers: 0
Hello,
I'm searching to create a table with add row button like the example but seem not work for my case.
I've done a jsfiddle for demo http://jsfiddle.net/supersonique/ncHQ5/8/
Any idea why I've this error in consol ( Uncaught TypeError: Cannot read property 'aoData' of null ) , and the row not created ?
[code]
tel +
id
Type
Tel
1
mob
0000000
2
mob
0000000
[/code]
[code]
function fnClickAddRow(table_id) {
$(table_id).dataTable().fnAddData( [
"Edit",
"Edit",
"Edit",
''
] );
}
$(document).ready(function(){
$(".dblclick").editable("http://www.appelsiini.net/projects/jeditable/php/echo.php", {
indicator : "",
submit: '',
cancel: '',
tooltip : "Double-click pour editer...",
cssclass : 'input-block-level',
event : "dblclick",
style : "inherit"
});
/* phonelist test*/
if($('#phonelist').length){
var asInitVals = new Array();
var oTable = $('#phonelist').dataTable( {
"aoColumnDefs": [{ "sType": "html", "aTargets": [ 2 ] }],
"bJQueryUI": false,
'bFilter': false,
'bSort': false,
'bPaginate': false,
'bInfo': false,
'bServerSide': false,
"sDom": ""
} );
};
/* end of table_display test*/
});
[/code]
Thanks for help.
I'm searching to create a table with add row button like the example but seem not work for my case.
I've done a jsfiddle for demo http://jsfiddle.net/supersonique/ncHQ5/8/
Any idea why I've this error in consol ( Uncaught TypeError: Cannot read property 'aoData' of null ) , and the row not created ?
[code]
tel +
id
Type
Tel
1
mob
0000000
2
mob
0000000
[/code]
[code]
function fnClickAddRow(table_id) {
$(table_id).dataTable().fnAddData( [
"Edit",
"Edit",
"Edit",
''
] );
}
$(document).ready(function(){
$(".dblclick").editable("http://www.appelsiini.net/projects/jeditable/php/echo.php", {
indicator : "",
submit: '',
cancel: '',
tooltip : "Double-click pour editer...",
cssclass : 'input-block-level',
event : "dblclick",
style : "inherit"
});
/* phonelist test*/
if($('#phonelist').length){
var asInitVals = new Array();
var oTable = $('#phonelist').dataTable( {
"aoColumnDefs": [{ "sType": "html", "aTargets": [ 2 ] }],
"bJQueryUI": false,
'bFilter': false,
'bSort': false,
'bPaginate': false,
'bInfo': false,
'bServerSide': false,
"sDom": ""
} );
};
/* end of table_display test*/
});
[/code]
Thanks for help.
This discussion has been closed.