I have a function using prototype for my objects but now in need of making an asynchronous call for setting some inputs the problem is that i am getting $$(...).asyncEach is not a function here is my code snippet
Customers.prototype.AddDatePickers = function()
{
$j.fn.asyncEach = function(callback){
var i = 0;
var elements = this;
var timer = setInterval(function () {
callback.call(elements[i], elements[i]);
if(++i >= elements.length) clearInterval(timer);
}, 0);
}
$$('.dateInputs').asyncEach(function (input) {
$(this).kendoDatePicker();
});
}
The reason why I have to do this is because there are lots of inputs with date pickers that need to get created so the unresponsive script message shows. I am trying to avoid that and this was given as an answer, my problem is I think (i am new to jquery) is that it is in a prototype function?, usually when I need to use $ i have to use $j in my prototype functions so that there is no conflict. But with this set up I am not really sure how to make it work.
asyncEach(no 'h')).$$('.dateInputs')should be$j('.dateInputs')$jthere.