DataTables/TableTools Multi select not working

DataTables/TableTools Multi select not working

nicksnicks Posts: 4Questions: 0Answers: 0
edited March 2013 in Bug reports
I *think* I've set everything up as indicated in the documentation but the style for selection doesn't show nor do the events fire.

I've never used jsbin before, so I'm not sure if this is the right way to share.
http://live.datatables.net/agayur/5

I've also tried "single" instead of "multi" with the same lack of results. My hope is to use the cool features described by @namlesila in this forum post: http://datatables.net/forums/discussion/10975/multiple-row-selection-with-ctrl-shift/p1

As an aside, the live.datatable.net jsbin will not run without modification. The jquery javascript include is below the datatables include and when ran it, it threw up on me :)

Replies

  • allanallan Posts: 63,685Questions: 1Answers: 10,498 Site admin
    You haven't included the `T` option in sDom - so TableTools won't initialise on that table.

    The other option is to use this method: http://datatables.net/release-datatables/extras/TableTools/alt_init.html

    Allan
  • nicksnicks Posts: 4Questions: 0Answers: 0
    Thanks for the response!

    I think I do have the t option included between the header and footer divs. I actually copied it from the sDom documentation page under the jquery note and removed the lf commands(also tried leaving them in). If I'm missing something there, could you kindly indicate where the t should actually go?

    I have also tried with the alternative init for TableTools and still didn't have any luck(http://live.datatables.net/agayur/9). In this one, after trying to go back to the basic example of sDom, I removed everything except t to try to limit the syntax there.
  • nicksnicks Posts: 4Questions: 0Answers: 0
    Anyone have any ideas?

    I think this is pretty much a bone stock version of making multi-select work and don't have any custom code in or around it. At least not as far as I can tell..
  • allanallan Posts: 63,685Questions: 1Answers: 10,498 Site admin
    You do have a `t` but `t !== T` .

    Use `t` for the table and `T` for TableTools.

    In your latest one, I does work just fine, but you haven't included a style to have the selected row highlight. This is what the TableTools CSS file uses:

    [code]
    table.DTTT_selectable tbody tr {
    cursor: pointer;
    *cursor: hand;
    }

    table.dataTable tr.DTTT_selected.odd {
    background-color: #9FAFD1;
    }

    table.dataTable tr.DTTT_selected.odd td.sorting_1 {
    background-color: #9FAFD1;
    }

    table.dataTable tr.DTTT_selected.odd td.sorting_2 {
    background-color: #9FAFD1;
    }

    table.dataTable tr.DTTT_selected.odd td.sorting_3 {
    background-color: #9FAFD1;
    }


    table.dataTable tr.DTTT_selected.even {
    background-color: #B0BED9;
    }

    table.dataTable tr.DTTT_selected.even td.sorting_1 {
    background-color: #B0BED9;
    }

    table.dataTable tr.DTTT_selected.even td.sorting_2 {
    background-color: #B0BED9;
    }

    table.dataTable tr.DTTT_selected.even td.sorting_3 {
    background-color: #B0BED9;
    }
    [/code]

    Allan
  • nicksnicks Posts: 4Questions: 0Answers: 0
    Thank you so much Allan it works perfectly now! I didn't notice the difference in case between what I had and what you were showing. (herpderp)
This discussion has been closed.