issue with selectable rows oTableTools

issue with selectable rows oTableTools

sanovasanova Posts: 8Questions: 0Answers: 0
edited May 2012 in DataTables 1.9
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.

Replies

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    That looks like it should work to me - can you give us a link to the page please?

    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
  • sanovasanova Posts: 8Questions: 0Answers: 0
    edited May 2012
    Thanks Allan for your reply. I can not post link, because it is on a local machine and net is NAT.

    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.
  • sanovasanova Posts: 8Questions: 0Answers: 0
    I solved in other way. I'm using only simple selection and adding simple button during datatable drowing.

    For what i need it is ok.

    Thanks again for your help
This discussion has been closed.