Formatting DataTables
Formatting DataTables
Dear DataTables community,
I just began programming with Ruby on Rails and I really love the gem datatables, since it allows live editing of my tables. However, I've got to admit that I really dislike the default looks of this gem, because I neither require a search bar, nor do I need the show field as well as the next and previous buttons. I only want a clear, clean and simple table which looks nicely. However, I can't figure out how to change the layout.
I tried the following:
jQuery ->
$('#capacity1s').dataTable ({
sPaginationType: "full_numbers"
bJQueryUI: true
bServerSide: true
sAjaxSource: $('#capacity1s').data('source')
"sDom": '<"top">rt<"bottom"flp><"clear">' });
where the last line is actually the one of interest, as it should turn off the respective dfields. However, nothing happens when I insert the code and refresh... I guess the solution is fairly simple but I can't figure out how. Please Help!
I just began programming with Ruby on Rails and I really love the gem datatables, since it allows live editing of my tables. However, I've got to admit that I really dislike the default looks of this gem, because I neither require a search bar, nor do I need the show field as well as the next and previous buttons. I only want a clear, clean and simple table which looks nicely. However, I can't figure out how to change the layout.
I tried the following:
jQuery ->
$('#capacity1s').dataTable ({
sPaginationType: "full_numbers"
bJQueryUI: true
bServerSide: true
sAjaxSource: $('#capacity1s').data('source')
"sDom": '<"top">rt<"bottom"flp><"clear">' });
where the last line is actually the one of interest, as it should turn off the respective dfields. However, nothing happens when I insert the code and refresh... I guess the solution is fairly simple but I can't figure out how. Please Help!
This discussion has been closed.
Replies
However, to disable the filtering input use the bFilter option. Regarding the styling, are you including the DataTables stylesheet? Perhaps you might want to consider trying the DataTables 1.10 stylesheet which is a bit nicer: http://next.datatables.net/examples/basic_init/zero_configuration.html
Beyond that, we'd need a link to a test case.
Allan