I’ve been at this one for a while now:
I’m using both jQuery and Prototype within Redmine, a RoR webapp. They play along well thanks to jQuery’s noConflict.
I’ve got jqGrid working fine too.
Now here’s my problem: I’m trying to use the Table Filter plugin by PicNet
but I get the following js error:
this.each is not a function
@ line 862 of prototype.js
function collect(iterator, context) {
iterator = iterator || Prototype.K;
var results = [];
this.each(function(value, index) {
results.push(iterator.call(context, value, index));
});
return results;
}
It’s obviously calling a prototype function while it should not, but the plugin code is minimized, and actually compiled with python, so there’s no un-minimized version…
I’m not very good with js to start with, and I’m stumped as to why it calls the wrong function…
P.S: I’m using
- jQuery 1.4.4
- Prototype 1.7
- Firebug 1.8.4 for debugging
Update: found the answer myself, see below!
I found the solution in the ‘closure’ lib, a dependency for Table Filter:
So I downloaded the necessary things (python, closure compiler, … ) and built the Table Filter code myself with this parameter set to false, and it works.
Now I’ve got another problem, but I should be ok. If not I’ll come back here and ask!