@lew
To get a datatable row object in knockout.js, you can use the following steps:
1
|
var rows = ko.observableArray([]); |
1 2 3 4 5 |
// Assuming you have a DataTable instance called "dataTable" dataTable.rows().every(function(rowIdx, tableLoop, rowLoop) { var row = this.data(); rows.push(row); }); |
1 2 3 4 5 |
var viewModel = { rows: rows }; ko.applyBindings(viewModel); |
Now, you can access the datatable row objects in your view by using the rows
observable array in your knockout bindings.