selction of one row in dataTable

selction of one row in dataTable

juju24juju24 Posts: 6Questions: 2Answers: 0

i create a datatable in my application which use bootstrap and when i use this code to select one row i obteein any things
$('#users tbody').on('click', 'tr', function () {

    if ( $(this).hasClass('selected') ) {
        $(this).removeClass('selected');


    }
    else {

        table.$('tr.selected').removeClass('selected');
        alert( 'You clicked on s row' );
        $(this).addClass('selected');
    }
} );

any ypdates can be welcome

Replies

  • allanallan Posts: 63,803Questions: 1Answers: 10,515 Site admin

    I'd suggest using Select if you want to do row selection.

    Allan

  • juju24juju24 Posts: 6Questions: 2Answers: 0

    please can you give me and example?

  • juju24juju24 Posts: 6Questions: 2Answers: 0

    thank you i solve the problem

  • allanallan Posts: 63,803Questions: 1Answers: 10,515 Site admin

    Of anyone else reading this thread, the examples are linked form the page I linked to above.

    Allan

This discussion has been closed.