Closed HazelGrant closed 9 years ago
Weird.
Could you try to comment off your application JS code?
Could you add console.log(...)
statements in wice_grid_init.js.coffee
and see if any of these methods get executed at all?
That was exactly what I needed to do. Thank you.
This had to do with the 'gon' gem. I have a javascript file where I point towards a gon variable which only exists on one page/within one controller action, but the file was available to the whole application. This meant there was a an undefined JavaScript variable trying to hang out all over the place, resulting in 'gon is not defined' errors on every page except the one where my gon variable was defined. So I made it so that script is only available in the one place, and the tables started filtering correctly. So I was just failing to pay close attention, although I'm not exactly sure why that interfered with filtering. Fixing that removed the problem.
Thanks again for your insight.
My current problem:
wice_grid filtering is not working.
in development, I can get the icons to show up. they are clickable but nothing is activated when clicking them. the page does not respond in any way. (by clickable, I mean, my cursor changes from arrow-pointer to hand-pointer. so at least some javascript is working…)
I followed the directions in the documentation. Here's how the code is implemented in my code base:
Gemfile
I called
bundle install
and the generator.wice_grid_config.rb
,wice_grid.yml
, andwice_grid.css.scss
have all been generated and I can find them easily.My application.js file:
And then vendor-javascripts:
wice_grid.css.scss is included in vendor-stylesheets which is included in application.css, similarly.
I have several tables. They all include at least one filterable/sortable column. Sorting is working just fine. This is a JavaScript issue.
There are no errors in the browser console.
In my application header on the page, the wice_grid js files show up as follows:
jQuery is loaded before wice_grid and is definitely present.
And yet the filtering button simply does not respond when clicked, on any of my tables.
in the console, when I type
I get
Have read this issue and found no explanation or solution. The only other somewhat related post I've come across is this but it's about Ajax messing up wice_grid and I have not used Ajax anywhere in my application at all.
I'm assuming this has something to do with some obscure problem in my own application. Some piece of JavaScript that's overriding the wice_grid filtering functionality silently? However I'm not sure and wanted to run this by people here, just in case I'm missing something obvious or there are questions to ask that I'm not thinking of properly.