Jump to content

1.7 Select2 and jQuery


Tom1369

Recommended Posts

Prestashop 1.7.6.2

Hello I want use Select2 in backoffice from prestashop. I think that select2 need jQuery so I add too. But jQuery is not added and select2 not working.

 

public function hookActionAdminControllerSetMedia()
{
$this->context->controller->addJquery(); 
$this->context->controller->addJQueryPlugin('select2'); 
$this->context->controller->addCSS($this->_path . 'views/css/' . $this->name . '.css', 'all'); 
}

 

Link to comment
Share on other sites

This  was removed in version 1.7.6.2

$this->context->controller->addJquery();

 

So I use external select2 not from prestashop and its works.

$this->context->controller->addJS(_PS_BO_ALL_THEMES_DIR_ . 'default/js/select2.min.js');

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...