I am building a Module for Prestashop that has a Front Office Controller. I'm wanting to use jQueryUI.
In my main php file for the module (extending the Module class) in included JQueryUI like this:
public function hookHeader()
{
$this->context->controller->addJqueryUI('ui.core');
$this->context->controller->addJqueryUI('ui.widget');
$this->context->controller->addJqueryUI('ui.mouse');
$this->context->controller->addJqueryUI('ui.slider');
}
I am checking my header, and I see all the scripts are being included in the correct order. (See image) jQuery all by itself works fine. But as soon as I'm calling a jQueryUI method, it says the method is not defined.
I'm just trying to get the basic example to work, two different ways, both don't work.
$(document).ready(function(){
$( "#date" ).datepicker();
});
and this doesn't work either:
$( function() {
$( "#date" ).datepicker();
} );
it keeps saying $(...).datepicker is not a function.
It doesn't look like jQuery is included twice, since it works fine when I don't call any of the UI methods. There's just this "migration" thing, but if I rename the file so it can't be included it throws a whole host of different errors (other functions it suddenly finds undefined).
Also I've already disabled all modules but mine. Same problem.
Interestingly enough
window.onload = function() {
if (typeof jQuery.ui !== 'undefined') {
alert("jquery ui is loaded!");
} else {
alert("not working");
}
}
this says it's loaded!
What could possibly be wrong?
How do I troubeshoot this?
