Get tableID from within render function
Get tableID from within render function
DocNC
Posts: 24Questions: 6Answers: 0
hello all
is it a "standard" way to access tableID from within a render function ?
I use this way, but there is a big warning about it.....
thanks
Michel
function render_xx(data,type,row,meta)
{
ID = meta.settings.sTableId;
}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
That is probably as good as it gets at the moment. What do you need it for?
Allan
I have complex data from vue
Original tables are one to many
COMPANY --> Contacts (name,surname,email)--> numbers (kind, number)
the vue make a JSON Array of objects.
data a list of contacts with numbers....
several tables send me the same kind of data.
When the data is in a "client" table, I have to show a cart (the client may buy) but not if from "contact" or "providers" table.
It seems easier to check the table id than to write several renders who will look the same only for that.
here is the render
thanks for your support.
Michel
Hi Michel,
Fair enough! Thanks for the explanation. Normally I will have a function that returns a configured rendering function - for example
$.fn.dataTable.render.moment( 'Do MMM YYYY' )
(from our date / time rendering plug-in), whereby you configure it when initialising the table, but this would be a valid option as well.Allan