Quantcast
Channel: DataTables 1.10 — DataTables forums
Viewing all articles
Browse latest Browse all 2366

Cell access on selected row

$
0
0

Updated... It seems the following code works when I remove the "visible".false from the code below. It looks like hiding the column also removed the variable? Also, it would be nice to access the variable by name (RSSID) vs. a fixed cell. Is that possible to do with datatables?

var FeedID = $("td:first", this).text();

I've got the following datatable:

oTable = $('#newsFeed').DataTable({
    "bProcessing": true,
    "bServerSide": true,
    "bSearchable": false,
    "sAjaxSource": 'RSSList',
    "bJQueryUI": true,
    "aoColumns": [
                    {
                        mDataProp: "RSSID", "bSortable": false, "bSearchable": false, "visible": false
                    },
                    {
                        mDataProp: "RSSName", "bSortable": false, "bSearchable": false
                    }
                 ]
});

and I've got the following click function:

$('#newsFeed tbody').on('click', 'tr', function () {
    var nTr = this.parentNode.parentNode;
    if (isOpen == '1')
    {
        oTable.fnClose(nTr);
    }
    else
    {
        /* Open this row */
        var FeedID = oTable.row('.selected',0).data();
        alert('feed ' + FeedID);
        console.log(this);
        $.get("feedList?nFeedID=" + FeedID, function (employees) {
            oTable.fnOpen(nTr, employees, 'details');
        } );
    }
});

What I want to do is access the column 'RSSID' from the selected (clicked) row. How do I do this? I've tried various forms of oTable.row... oTable.cell...


Viewing all articles
Browse latest Browse all 2366

Trending Articles