Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sortable Arrow Images Not Showing #3

Open
bbtfr opened this issue Sep 21, 2014 · 2 comments
Open

Sortable Arrow Images Not Showing #3

bbtfr opened this issue Sep 21, 2014 · 2 comments

Comments

@bbtfr
Copy link

bbtfr commented Sep 21, 2014

I use datatables-rails-bs3 with my Rails 4 project, and I got an exception in production mode.

GET http://www.pandacourse.com/assets/datatables/sort_asc.png 404 (Not Found) admin-e14a70de3039aadeed15c39473a436ad.js:2
GET http://www.pandacourse.com/assets/datatables/sort_both.png 404 (Not Found) admin-e14a70de3039aadeed15c39473a436ad.js:2

In admin.js there are just 2 lines.

//= require dataTables/jquery.dataTables
//= require dataTables/jquery.dataTables.bootstrap

And I have added admin.js to Rails.application.config.assets.precompile

Rails.application.config.assets.precompile += %w( html5shiv.min.js respond.min.js admin.js )

Now, to fix this, I have to add following lines to my css file:

table.table thead .sorting { background: image-url('datatables/sort_both.png') no-repeat center right; }
table.table thead .sorting_asc { background: image-url('datatables/sort_asc.png') no-repeat center right; }
table.table thead .sorting_desc { background: image-url('datatables/sort_desc.png') no-repeat center right; }

table.table thead .sorting_asc_disabled { background: image-url('datatables/sort_asc_disabled.png') no-repeat center right; }
table.table thead .sorting_desc_disabled { background: image-url('datatables/sort_desc_disabled.png') no-repeat center right; }

Use image-url instead of url, and add all image filenames to precompile

Rails.application.config.assets.precompile += %w( html5shiv.min.js respond.min.js admin.js 
  datatables/sort_both.png datatables/sort_asc.png datatables/sort_desc.png 
  datatables/sort_asc_disabled.png datatables/sort_desc_disabled.png )

It works.

But I think it's better to be done in your engine file.

@avinashl3175
Copy link

Sorting arrow visible only after on click of individual table header.
Please suggest some solution.

@DevanB
Copy link
Owner

DevanB commented Oct 17, 2016

Woah, it's been a while!

I'll try updating the gem to solve @bbtfr's problem.

While I'm doing that, I'll look into your problem @avinashl3175.

Thanks for using the gem. Give me a few days to fix it, and I'll respond here after the new version is published!

-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants