简体   繁体   中英

Get particular row data from jquery datatable

I want to get a particular row data from jQuery data table. Can anyone help me to get the record with first column id?

function showchnldetail(val) {
    var oTable = $('#example').dataTable();
    var aData = oTable.fnGetData(val);
    if (null != aData) {
        alert('enter');
    }               
}

val is first column id. I want to store the data in a variable.

var aDataSet = [ ['96', 'xx', 'product1', '144']];

I assign the above dataset to otable .

var nodes = datatable.fnGetNodes();
var row = null;

jQuery.each(nodes, function(key, fila){
    if(jQuery(fila).attr('id') == idrow){
        row = fila;
    }
});       

var pos = datatable.fnGetPosition(row);
      datatable.fnUpdate('new value', pos, 1);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM