Multiple table with aoColumnDefs
Multiple table with aoColumnDefs
blackmarneus
Posts: 5Questions: 0Answers: 0
Hi everyone,
I've got two tables on the same page which i initialize in the same times ($(document).ready).
I use these with tabbable (bootstrap 2.3.1) to switch from one to the other.
The first one haven't any problem, it is correctly initialized. But the second not. The column width isn't right.
Can you help me please?
Thanks
I've got two tables on the same page which i initialize in the same times ($(document).ready).
I use these with tabbable (bootstrap 2.3.1) to switch from one to the other.
The first one haven't any problem, it is correctly initialized. But the second not. The column width isn't right.
Can you help me please?
Thanks
This discussion has been closed.
Replies
At the moment, all I can suggest is that you use fnAdjustColumnSizing when the second table is made visible.
Allan
Ok sorry, i'm new in this forum and i'm french, i don't understand exactly the rules but i'll try to do my best!
link to the property in question : http://www.datatables.net/ref#sWidth
the code i use :
[code]
$(document).ready(function() {
$('#tableEncours').dataTable( {
"bPaginate": true,
"bLengthChange": true,
"bFilter": true,
"bSort": true,
"bInfo": false,
"bAutoWidth": true,
"sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"oLanguage": {
"sSearch": "Filtre :"
},
"aoColumnDefs": [
{ "sWidth": "60%", "aTargets": ["detail"] }
]
} );
var historique = $('#tableHistorique').dataTable( {
"bPaginate": true,
"bLengthChange": true,
"bFilter": true,
"bSort": true,
"bInfo": false,
"bAutoWidth": true,
"sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"oLanguage": {
"sSearch": "Filtre :"
},
"aoColumnDefs": [
{ "sWidth": "60%", "aTargets": ["detail"] }
]
} );
} );
[/code]
Allan
I've some JSPX build with Tiles which contains part of datatable, my data come from JEE application and i initialize it with JQuery.
I don't know how i can link you this, moreover, my application aren't yet online...
Allan
Thanks for your answer, if i find the solution i'll come back to let you know how i fix it.
Check it out: http://jed-datatables.ca/jed/
The problem is fixed : i'd let the "bAutoWith : true" property, it seems to be in conflict with aoColumnsDefs. All work fine.
Thanks you for your answers!
I had the same issue.
My problem was I was doing server side/AJAX calls to get the data.
So when I tried to set specify % widths on some columns it just broke; I just had the processing throbber shown - it would be nice if conflicting configuration settings caused a console log entry or at least an alert to avoid unnecessary time spent double checking the syntax and surrounding JS.
Generally it should - although obviously invalid syntax is something that the Javascript engine will check for. If you could show me what you had that caused the problem I might be able to do something about it in a future release?
Allan