when i click on anny row to get column data it gives me arror 'Cannot read property '1' of undefine'

when i click on anny row to get column data it gives me arror 'Cannot read property '1' of undefine'

abd17abd17 Posts: 4Questions: 3Answers: 0

this is my code

var table = $('#tblContactList').DataTable();

$('#tblContactList tbody').on('click', 'tr', function () {
    var data = table.row(this).data();
    debugger;
    $(this).toggleClass('selected');
    alert('You clicked on ' + data[1] + '\'s row');
});

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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

This discussion has been closed.