Table with the first static row and always visible
Table with the first static row and always visible
antoniog85
Posts: 3Questions: 0Answers: 0
Hi,
I would like to make a table with the first row containing input field to add other rows.
I saw that there is fnAddData function, so I tried:
[code]$(document).ready(function() {
oTable = $("#tblCarichi").dataTable({
"sDom": '<"top"ip>rt<"bottom"><"clear">',
"sPaginationType": "two_button",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "?action=getElenco",
"iDisplayLength": 10,
"oLanguage": {"sUrl": "/html/plugin/datatables/language/it.txt"},
"aoColumns": [
{"bSortable": false},
{"bSortable": false},
{"bSortable": false},
{"sWidth": "30px", "bSortable": false, "bSearchable": false}
]
});
oTable.fnAddData([
'',
'',
'',
''
]);
});[/code]
but my custom row doesn't appear and there aren't errors.
How can I do?
Thanks.
I would like to make a table with the first row containing input field to add other rows.
I saw that there is fnAddData function, so I tried:
[code]$(document).ready(function() {
oTable = $("#tblCarichi").dataTable({
"sDom": '<"top"ip>rt<"bottom"><"clear">',
"sPaginationType": "two_button",
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "?action=getElenco",
"iDisplayLength": 10,
"oLanguage": {"sUrl": "/html/plugin/datatables/language/it.txt"},
"aoColumns": [
{"bSortable": false},
{"bSortable": false},
{"bSortable": false},
{"sWidth": "30px", "bSortable": false, "bSearchable": false}
]
});
oTable.fnAddData([
'',
'',
'',
''
]);
});[/code]
but my custom row doesn't appear and there aren't errors.
How can I do?
Thanks.
This discussion has been closed.
Replies
An alternative is to put the inputs into the header in a second TR row, but with TD elements, rather than TH.
Allan
In any case, I tried your suggestion to put my custom rows in the header and it works. I didn't think at this solution!
But if there is another solution to achieve the same purpose, I'd like to know how.
Thank you.