如何在jQuery DataTables中获取选中的行ID

时间:2015-07-17 06:53:20

标签: javascript jquery datatables

在下面的代码中我有一个jQuery DataTable,我希望获得选定的行ID并将其存储到数组中。但我只获得一行ID SchoolID,但我希望SchoolIDClassIDSectionID选中复选框。

var val[]; //global
"aoColumns": [
    {
        "mDataProp": "SchoolID",
        "bSearchable": false,
        "bSortable": false,
        "sWidth": "10%",
        "mRender": function(data, type, full) {
            val = '<input type="checkbox" id="chkSchoolID"  onclick="CheckRow(' + full.SchoolID + ')"></button>';
            return val;
        }
    },
    {
        "mDataProp": "SchoolID",
        "sWidth": "25%"
    }, {
        "mDataProp": "ClassID",
        "sWidth": "25%"
    }, {
        "mDataProp": "SectionID",
        "sWidth": "25%"
    },
],
function CheckRow() {
    alert(val);
}

0 个答案:

没有答案