Adding refrences to DataTable

Viewed 24

I have 2 DataTables on a page that are similar but different.

When I update one table I want to write data to a div below that table. The data being written for each table uses the same function but the output div is different.

Is there any way that I can add an extra field to the data table so the drawCallback function can get the proper div id to write so 1 function can be used for both tables?

I tried just adding .refDiv to the DataTable variable and this works if I refrence via the variable but does not work if using the generic this.api()

any ideas

1 Answers

Figured it out. By adding

data-ref="domID" to the table html I could then get the id by using

divId=this.api().tables().nodes().to$().data("ref");

Related