How to loop through all rows in DataTables jQuery?

前端 未结 4 2012
-上瘾入骨i
-上瘾入骨i 2020-12-25 12:54

I am using jquery plugin DataTables for building nice table

  var table = $(\'#example\').DataTable({
    \"data\": source
});
4条回答
  •  梦毁少年i
    2020-12-25 13:32

    Datatables have an iterator for each row rows().every() with this referring to the context of the current row being iterated.

    tableName.rows().every(function(){
        console.log(this.data());
    });
    

提交回复
热议问题