0
votes

In my RoR project I'm trying to use plugin for dataTable - columnFilter (http://jquery-datatables-column-filter.googlecode.com/svn/trunk/index.html). It placed in : app/assets/javascripts/jquery.dataTables.columnFilter.js (as all js-files)

I trying to call it from my view:

<script type="text/javascript" charset="utf-8">
 $(document).ready(function() {

var oTable = $('#t1').dataTable({
    "oLanguage": {
        "sSearch": "Search:"
    }
}).columnFilter({
                sPlaceHolder: "head:before",
                aoColumns: [ { type: "select"},
                        { type: "select", values: [ 'First', 'Second']},
                         null,                
                         null,
                         null
                    ]
            });
});

But it does not work. And I can't see any errors. But if I'll copy the content of dataTables.columnFilter.js to my view (inside script tag...) it works perfectly...

How can I modify my code in order to stay filtering in external file?

1
Are both files jquery.dataTables.columnFilter.js and dataTables.columnFilter.js loaded?Mindbreaker
Finally solved. Seems, files were not loaded.ferrilful

1 Answers

0
votes
Solved. With using asset_path

<script class="jsbin" src="<%= asset_path('jquery.dataTables.js') %>"></script>
<script src= "<%= asset_path('jquery.dataTables.columnFilter.js') %>"></script>