leikind / wice_grid

A Rails grid plugin to create grids with sorting, pagination, and (automatically generated) filters
MIT License
537 stars 215 forks source link

Can't get wice_grid to load js file in Application.j #148

Closed VasilyShelkov closed 10 years ago

VasilyShelkov commented 10 years ago

So I've followed the setup instructions, installed wice_grid, generated it and made sure i have JQuery and JQuery ui as well.

The grid renders with the correct data however despite having included : //= wice_grid in the Application.js file I keep getting the error

"wise_grid.js not loaded, WiceGrid cannot proceed! make sure that you have loaded... ...//= wice_grid.js to app/assets/javascript/application.js"

here's my application.js file: // This is a manifest file that'll be compiled into application.js, which will in$ // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vend$ // or vendor/assets/javascripts of plugins, if any, can be referenced here using $ // // It's not advisable to add code directly here, but if you do, it'll appear at t$ // compiled file. // // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-dire$ // about supported directives. // //= require jquery //= require jquery_ujs //= require jquery_ui.all //= require jquery.ui.datepicker //= require_tree //= require bootstrap //= require wice_grid //= require turbolinks .

jQuery.ajaxSetup({ 'beforeSend': function(xhr) { xhr.setRequestHeader("Accept", "text/javascript")$ });

$.fn.subSelectWithAjax = function() { var that = this; this.change(function() { $.post(that.attr('rel'), {id: that.val()}, null, "script"); });

ruby version:2.0.0p247 rails version:4.0.4 wice_grid version: 3.4.2

has anyone got any suggestions as to how I can fix this ? Really need it to work as it's an excellent gem for my project

Many Thanks

Vasily

VasilyShelkov commented 10 years ago

PS the js file definitely hasn't been loaded when checking in the browser, doesn't exits

VasilyShelkov commented 10 years ago

dw not problem with wice_grid....beautiful gem, thanks :)