Columns names cannot call in array form??
Columns names cannot call in array form??
eoam13
Posts: 2Questions: 1Answers: 0
Hi everyone. I have the following:
$(document).ready(function() {
$('#example').DataTable( {
data: arrObj,
columns: arrObj2,
} );
} );
arrObj2 is an array but it is not working. It does not show the titles for each column. How can I change this?
BR
This discussion has been closed.
Answers
It's most likely related to your arrObj2 not being in valid format. Can provide that?
Agreed - we'd to know the contents of
arrObj
andarrObj2
.Allan
I am sorry for the late response. arrObj2 is coming from:
Thanks.
If I'm reading the code above correctly you are just setting
columns
to an array of strings. Is that correct? Is so, that's not a validate DataTables initialisation. Seecolumns
andcolumns.title
for how to set a column title.Allan