Help with misaligned sort indicators
Help with misaligned sort indicators
Hi,
I'm not sure how to debug this problem. I would greatly appreciate any advice pointing me in the right direction.
I'm on Mac OS X 10.9.3 with Ruby 2.1.2, Rails 4.1.4, and jquery-datatables-rails (2.1.10.0.2). The sort indicators at the top of the columns on my tables are misaligned. This must have happened within the past few days. Here is an example,
Note: I've zoomed up the image for clarity.
Thank you for any assistance.
This question has an accepted answers - jump to answer
Answers
I was hoping someone else would comment, but I'll take a guess....
Try checking to make sure your Datatable is only initialized once. I've seen that before.. just can't remember how it happened.
Inspect the sort indicator using chrome dev tools or a similar program, actually just paste us the entire th cell's HTML
Here is the entire html for the TH:
Thanks for any assistance.
Also, I don't think I'm initializing it twice in any place, but specifically what should I look for?
In my rails app, on each different page's .js files, I'm initializing the tables that are used on that page, like so:
This one is for my templates page, I have a sections page, and a blueprint page, each with similar but slightly different table options. Thanks again for any help.
PS: Thank you for a great library. I know how busy everyone is and how much effort support takes. I'm extremely grateful for any help with this problem.
Thanks & keep up the good work!
Bob
Additional source from my problem page, in case it helps:
My CSS/JS inclusion order:
And, the beginning of my table:
This might be part of the issue...
demo_table_jui.css
isn't needed... you do however need http://cdn.datatables.net/plug-ins/be7019ee387/integration/jqueryui/dataTables.jqueryui.cssOk this is weird. I've added the direct links to the CDN version, but now the image alignment and offset problem is even worse see here.
New css & js includes, including link to CDN:
Beginning of table declaration now:
The only class in my tables which applies the up down carrot is
.sorting
try deleting that from your source in dev tools and see what's causing the extra sort icons to appear. If you can post a live example on jsfiddle or some place that would helpSomeone else just pointed out that in addition to including the CDN version there was a duplicate CSS file being loaded from the gem by this line:
<link href="/assets/dataTables/jquery.dataTables.css?body=1" media="all" rel="stylesheet" />
When I removed that, the duplicate and misaligned table sort icons were removed, now there is only one and it looks fine.
Thank you so much.