Doing a shift select, Tabletools not working

Doing a shift select, Tabletools not working

has07has07 Posts: 2Questions: 0Answers: 0
edited April 2015 in Free community support

Hello,

I am currently working on dataTables. This is the first time I am working with them. I have function to initialize the dataTable, I have my Tabletools.js included in my jsp page. I gave the Tabletools in dataTable function(I only need multiple row selection with shift ) as follows:

tableTools: {
"sRowSelect": "os"
}

I am trying to do a shift select on my dataTable rows, this is not working. Did I miss anything ? Is there a way to do shift select on columns instead of rows ? if, so how to do it. If not through Tabletools, is there any other way to do shift select on only columns for dataTables. Currently I can select multiple rows and sinlge row in my dataTable but I want to Shift select rows/columns in the dataTable. Please help me this.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Please link to a test page showing the issue (as per the forum rules) so we can help to debug and resolve the issue.

    Allan

  • has07has07 Posts: 2Questions: 0Answers: 0

    table.js

    //Initialization of datatable

    function dT() {

    tab = $('table.display').DataTable({
        "aaSorting": [],
        "scrollY": "1000px",
        "bPaginate": false,
        "bAutoWidth": false,
        "bFilter": false,
        "bInfo": false,
        "order": [],
        "columnDefs": [{
            "visible": false,
            "targets": 1
        }]
      });
    

    // i have three tabs - in tab one I will display onedatatable
    // on tab two another datatable
    //on tab three another datatable

    var tabone = $('#Tableone').DataTable();
    $('#TableoneColumns a').each(function(i, obj) {
        if (Tableone.column(i).visible()) {
            $(this).css('color', '');
        } else {
            $(this).css('color', '#FFFFFF');
        }
    });
    

    // i have included only srowselect because I wanted only my rows to be selected on shift select. I saw a row selector on specific cells - but did not understand how can I apply on columns in a datatable so tried srowselect: os to test whether I could select my rows on shift select or not.

    var dtable = $('#Tableone').DataTable({

                dom: 'T<"clear">lfrtip',
                tableTools: {
                "sRowSelect": "os"
                }
            });
    

    // in my table.jsp - these are the files I have included i my jsp page.

    ">
    ">
    ">
    ">

    below is thelink to tabletools js i have included

    http://datatables.net/release-datatables/extensions/TableTools/js/dataTables.tableTools.js

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Can you please link to the page you are working on, or create a page showing the problem using http://live.datatables.net , JSFiddle, CodePen or any other site.

    Allan

This discussion has been closed.