issue with selectable rows oTableTools
issue with selectable rows oTableTools
sanova
Posts: 8Questions: 0Answers: 0
Hi,
I have just tried to enable selectable rows into datatable without luck.
Loaded Libraries:
- jquery.dataTables.js;
- demo_page.css"; (style)
- demo_table_jui.css"; (style)
- demo_table_custom.css"; (style)
This is my inizialize function:
function () {
oTable = $('#b-datatable').dataTable({
"sDom": 'T<"clear">lfrtip',
// Table Option
"oTableTools": {
"sRowSelect": "single",
"fnRowCallback": function(node) {
alert('id row: ' + node.id);
}
},
"bProcessing": true,
"bStateSave": true,
"sAjaxSource": "../../json/handlerelencobersagli_dt.txt",
"bJQueryUI": true,
"sPaginationType": "full_numbers"
}
Everything works fine but not rows selection. If i click on a row it does no action, as it can not see oTableTools option.
What wrong in my code? is there a specific library to load to have sRowSelect working?
Thanks in advanced.
I have just tried to enable selectable rows into datatable without luck.
Loaded Libraries:
- jquery.dataTables.js;
- demo_page.css"; (style)
- demo_table_jui.css"; (style)
- demo_table_custom.css"; (style)
This is my inizialize function:
function () {
oTable = $('#b-datatable').dataTable({
"sDom": 'T<"clear">lfrtip',
// Table Option
"oTableTools": {
"sRowSelect": "single",
"fnRowCallback": function(node) {
alert('id row: ' + node.id);
}
},
"bProcessing": true,
"bStateSave": true,
"sAjaxSource": "../../json/handlerelencobersagli_dt.txt",
"bJQueryUI": true,
"sPaginationType": "full_numbers"
}
Everything works fine but not rows selection. If i click on a row it does no action, as it can not see oTableTools option.
What wrong in my code? is there a specific library to load to have sRowSelect working?
Thanks in advanced.
This discussion has been closed.
Replies
TableTools will add the class "DTTT_selected" to the TR elements that are selected - do you have a style which is setting a visual indicator that the class has been applied (the default TableTools CSS should have that in it).
Allan
I have TableTools workink now. Just added following library:
- TableTools.js
- ZeroClipboard.js
And in oTableTools options the following:
- "sSwfPath" : "extras/TableTools/media/swf/copy_cvs_xls_pdf.swf"
- "aButtons": ["copy", "cvs", "pdf"]
Just one comment: if i didn't use default buttons "copy" "print" "pdf" .. i could not do that.
For example, if i wanted use "Delete" , "Modify" , "Add" buttons, how can i do that?
Removing swf path (and "aButtons" option), TableTools returns me an error:
GET copy_cvs_xls_pdf.swf 404 not found
so how can i pass values of selected row to my own functions on clicking personal buttons.
For what i need it is ok.
Thanks again for your help