how to obtain the highlight selected row

how to obtain the highlight selected row

izumovizumov Posts: 178Questions: 14Answers: 0

how to obtain the highlight of the mouse of line distinguished by mouse click and add possibility of moving of the distinguished line a keyboard?

Answers

  • colincolin Posts: 15,143Questions: 1Answers: 2,586
    edited May 2019

    Hi @izumov ,

    If you're using Select extension , this example will help.

    If not, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • izumovizumov Posts: 178Questions: 14Answers: 0

    I have two versions of the code. The first works and the second gives errors difference only in the links to the plugin. Prompt in what there can be a problem.How to fix the error.
    1.version working-
    <head>


    <link rel="stylesheet" type="text/css" href="datatables.css"/>


    </head>

    <body.>

    Kod LKod1c login Password name INN profit e_mail telefon
    Kod LKod1c login Password name INN profit e_mail telefon

    </body>
    $(document).ready(function()

    {
    $('#clients').DataTable( {
         "order": [[ 0, "desc" ]],
         scrollY: true,
         scrollX:true,
    //   "sRowSelect": "single",
        "processing": true,
        "bPaginate": true,
        "bSort": true,
        "serverSide": true,
        "autoWidth":true,
        // "ajax": "proc.php"
        "ajax": "server_processingclients.php"
    } );
    $('#clients tbody').on('dblclick', 'tr', function () {
        var table =$('#clients').DataTable();
        var data = table.row( this ).data();
        document.location.href="http://localhost/client15.html?id="+data[0];
        //alert( 'You ID '+data[0]+'\'s row' );
    } );
    

    //var oTable = $('#example').dataTable();

    // Sort immediately with columns 0 and 1
    //oTable.fnSort( [ [0,'asc'], [1,'asc'] ] );
    } );
    2.version with error
    <head>


    <link rel="stylesheet" type="text/css" href="select_dataTables.css"/>


    </head>

    <body.>

    Kod LKod1c login Password name INN profit e_mail telefon
    Kod LKod1c login Password name INN profit e_mail telefon

    </body>
    $(document).ready(function()

    {
    $('#clients').DataTable( {
         "order": [[ 0, "desc" ]],
         scrollY: true,
         scrollX:true,
    //   "sRowSelect": "single",
        "processing": true,
        "bPaginate": true,
        "bSort": true,
        "serverSide": true,
        "autoWidth":true,
        // "ajax": "proc.php"
        "ajax": "server_processingclients.php"
    } );
    $('#clients tbody').on('dblclick', 'tr', function () {
        var table =$('#clients').DataTable();
        var data = table.row( this ).data();
        document.location.href="http://localhost/client15.html?id="+data[0];
        //alert( 'You ID '+data[0]+'\'s row' );
    } );
    

    //var oTable = $('#example').dataTable();

    // Sort immediately with columns 0 and 1
    //oTable.fnSort( [ [0,'asc'], [1,'asc'] ] );
    } );
    getting the following error
    dataTables_select.js:55 Uncaught TypeError: Cannot set property 'select' of undefined
    at dataTables_select.js:55
    at dataTables_select.js:47
    at dataTables_select.js:49

  • colincolin Posts: 15,143Questions: 1Answers: 2,586

    You would get that error if you haven't included the libraries. As mentioned above, could you link to a test case demonstrating the problem please, it'll help to ensure we're talking about the same things,

    Cheers,

    Colin

  • izumovizumov Posts: 178Questions: 14Answers: 0

    I bring a code
    <head>

    ****
    <link rel="stylesheet" type="text/css" href="select_dataTables.css"/>


    </head>

    <body.>

    Kod LKod1c login Password name INN profit e_mail telefon
    Kod LKod1c login Password name INN profit e_mail telefon

    </body>
    the as see required files in him are connected an error is nevertheless given out

  • izumovizumov Posts: 178Questions: 14Answers: 0

    in the debugger I see that the library is connected and the error is in the line of code from the library code cite DataTable.select = {};

  • kthorngrenkthorngren Posts: 20,302Questions: 26Answers: 4,769

    As Colin mentioned please provide a test case replicating the issue.

    Looking at your code snippets its hard to say what could be the problem. What are you doing when the Uncaught TypeError: Cannot set property 'select' of undefined occurs?

    Also when posting code please use Markdown formatting. To highlight code, please use triple back ticks (```) on new lines before and after the code block.

    Kevin

This discussion has been closed.