Bootstrap Datatables not working
Bootstrap Datatables not working
themacgenius
Posts: 4Questions: 0Answers: 0
Hi,
All I'm trying to do (for right now) is duplicate the table in the example for DataTables:
http://www.datatables.net/blog/Twitter_Bootstrap_2
Example: http://www.datatables.net/media/blog/bootstrap_2/
I have it on my server here:
http://myestoretemplates.com/tts/test.php
Or - here is a JSfiddle with it too: http://jsfiddle.net/2DCzp/
And it is showing up with double rows and the pagination is not working. I'm figuring I'm doing something wrong, but the problem is - I have all the scripts I'm supposed to have, right? All the js files in the working example are included in my example.
I'd appreciate any help - thanks a ton!
All I'm trying to do (for right now) is duplicate the table in the example for DataTables:
http://www.datatables.net/blog/Twitter_Bootstrap_2
Example: http://www.datatables.net/media/blog/bootstrap_2/
I have it on my server here:
http://myestoretemplates.com/tts/test.php
Or - here is a JSfiddle with it too: http://jsfiddle.net/2DCzp/
And it is showing up with double rows and the pagination is not working. I'm figuring I'm doing something wrong, but the problem is - I have all the scripts I'm supposed to have, right? All the js files in the working example are included in my example.
I'd appreciate any help - thanks a ton!
This discussion has been closed.
Replies
[code]
$(document).ready(function() {
$('#example').dataTable( {
"sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>"
} );
} );[/code]
But then I got this error:
DataTables warning (table id = 'example'): Cannot reinitialise DataTable.
To retrieve the DataTables object for this table, pass no arguments or see the docs for bRetrieve and bDestroy
[code]
/* Table initialisation */
$(document).ready(function() {
$('#example').dataTable( {
"sDom": "<'row'<'span6'l><'span6'f>r>t<'row'<'span6'i><'span6'p>>",
"sPaginationType": "bootstrap",
"oLanguage": {
"sLengthMenu": "_MENU_ records per page"
}
} );
} );
[/code]
Take a look here https://github.com/Jowin/Datatables-Bootstrap3/blob/master/BS3/index.html
Example in this http://www.datatables.net/media/blog/bootstrap_2/ initialize the code in the javascript file itself.
Allan