fnGetData extended when using deep property reading for a data source (similar to Thread ID 4988)

fnGetData extended when using deep property reading for a data source (similar to Thread ID 4988)

jamjon3jamjon3 Posts: 22Questions: 0Answers: 0
edited May 2011 in DataTables 1.8
I'm using an array of objects to build datatables but I'm seeing the results of this function is returning an array rather than the source object. May have misunderstood this in the developer enhancements but that would be very helpful to get back that single object.

I'm prepping a button to delete a selected row so this is the event tied to that button (which later will have an AJAX call to handle that and then will remove this row from the table if the AJAX response confirms it's deletion on the back end). Right now, I'm just displaying that "aData" for that row.

[code]

.click(function() {
if(!($(this).button("option", "disabled"))) {
$.each(connectionSourceDataTable.fnGetNodes(),function() {
if($(this).hasClass('row_selected')) {
alert(JSON.stringify(connectionSourceDataTable.fnGetData(this)));
return false;
} else {
return true;
}
});
// alert('Remove this source');
}
})
[/code]

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    Couldn't agree more, and funnily enough good timing as I've just committed a fix for this. If you grab the latest nightly you'll get the data source object, be it an array or object, rather than the display array :-).

    Allan
  • jamjon3jamjon3 Posts: 22Questions: 0Answers: 0
    Pulling it down this morning. BTW: Expect a package from Amazon 19 May 2011 - 21 May 2011 (sorry, don't use PayPal, long story I won't go into...). Again, fantastic!!!
  • jamjon3jamjon3 Posts: 22Questions: 0Answers: 0
    This works GREAT!!! Thanks!!!
This discussion has been closed.