Issue with Titles
Issue with Titles
oneillg
Posts: 33Questions: 9Answers: 0
Hi,
I have been every way from Sunday with this one. But I boiled it down to the minimal amount of code to reproduce the issue. I am so hoping it's not something stupid I have done.
The problem is that everything works exactly as I would expect EXCEPT the last title gets cut off. All the data appears OK. Here is the code:
// I need to do it this way because I don't know how many columns I might have originally. User defined.
var columnsObj = [];
columnsObj.push( { "title": "Month", "data": "Month" });
columnsObj.push( { "title": "2014", "data": "2014" });
columnsObj.push( { "title": "2015", "data": "2015" });
columnsObj.push( { "title": "2016", "data": "2016" });
columnsObj.push( { "title": "2017", "data": "2017" });
columnsObj.push( { "title": "Service", "data": "Service" });
// I usually get this data via ajax which produces same result
var newData = [];
newData.push( { "2014": "$100", "2015": "$200", "2016": "$500", "2017": "$600", "Month": "January", "Service": "ABC" });
var table;
var domStyle = 'Bfprti';
table = $("#monthlyFinancials-table").DataTable( {
'dom': domStyle,
"destroy": true,
'bSort': false,
'searching': true,
'bAutoWidth': false,
'buttons': null,
'select': false,
'iDisplayLength': 25,
'data': newData,
'columns': columnsObj
});
[html]
[/html]
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I built a test case for you by copying your code into the base Datatable's jsbin.
http://live.datatables.net/qohefilu/1/edit
Looks like all the titles and columns are shown.
Maybe you can update the test case to show your issue.
Kevin
Thanks Kevin. Nice move. I did that with another table but not this exact one. It is still happening in my own environment but your help has nudged me down a different track. Thanks.
PS. I was using regular JSBin - now I know about this one thanks to you.
And . . .there it is. Something stupid I had done. I was already incorrectly populating the table html somewhere else . . . sigh
Thanks again.