Formatting DataTables

Formatting DataTables

Jan_IJan_I Posts: 3Questions: 0Answers: 0
edited March 2014 in General
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!

Replies

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    The gem isn't part of the DataTables project - it is kindly provided by someone else, so I can't really offer any help with it specifically.

    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
This discussion has been closed.