EchMultiselect(TypeError: m.easing[this.easing] is not a function) - yii

I am using EchMultiselect to create a multiple select.
$this->widget('ext.widgets.EchMultiSelect',
array(
'model' => $modelCtas,
'dropDownAttribute' => 'CATServiceID',
'data' => $data,
'dropDownHtmlOptions' => array(
'style' => 'width:378px;',
),
It works fine, but it doesn’t collapse and the close button is not working.
I get the JQuery error TypeError: m.easing[this.easing] is not a function.
What could be the issue.?

To fix this issue you need to make sure:
1) jQuery UI is used in your project.
2) if jQuery UI its include, Then you have an error in jQuery UI version, this ext is tested on Yii 1, so that make sure you are include truth version for jQuery UI if you using Yii2, or upgrade ext if you are in Yii 1 version.

Related

Making a dynamic Form in Prestashop

What I want to achieve Image! Hi I am working on a module in prestashop. What I want is that there should be a button (any-name: Add new field) in the backoffice-(Module Configuration page the first page that comes when you configure your module) that the user presses and it should add a new input field in the form. This all should be done using the helper classes. How can I achieve that? Some code would be grateful! I have uploaded an image. I have tried it using jQuery and it works but I need this done using helperForms in prestashop! In jQuery if I press the add new field button it adds an input field dynamically but the helper-classes are not used in that case.
Here is a link to the documentation :
http://doc.prestashop.com/display/PS16/Using+the+Helper+classes
the documentation is for PS 1.6 but it should also work with PS 1.7
Here is an example of code that generate a form with Helper Classes :
$this->fields_form = array(
'legend' => array(
'title' => $this->l('Edit carrier'),
'image' => '../img/admin/icon_to_display.gif'
),
'input' => array(
array(
'type' => 'text',
'name' => 'shipping_method',
),
),
'submit' => array(
'title' => $this->l('Save'),
'class' => 'btn btn-default pull-right'
)
);
I don’t know if you can use Helper class for custom forms that update custom datas. I’m sure you can use them to update module configuration and prestashop object (customer, etc.)
Helper classes enable you to generate standard HTML elements for the
back office as well as for module configuration pages.

Using Yii2 Bootstrap widgets with Smarty

I've installed Yii2 together with Smarty for my views.
Smarty itself is working, but I can't figure out how to use the bootstrap widgets with smarty, nor find any examples.
With the default Yii renderer the widgets work great, and lots of examples are available. But when using Smarty templates documentation is nearly non existing.
How would I define this example with Smarty ?
echo Alert::widget([
'options' => [
'class' => 'alert-info',
],
'body' => 'Alert widget',
]);
Obviously the first thing would be
{use class="yii\bootstrap\Alert"}
But I can't find an example of how to define the widget itself.
You should simply try this :
{use class='#yii\bootstrap\Alert' type='function'}
{Alert body='Alert widget' options=['class' => 'alert-info']}
Read more : http://www.yiiframework.com/doc-2.0/guide-tutorial-template-engines.html#importing-static-classes-using-widgets-as-functions-and-blocks
After changing config/web.php and adding:
'globals' => ['html' => '\yii\helpers\Html'],
'uses' => ['yii\bootstrap'],
in the view section, it works.
{use class='yii\bootstrap\Alert' type='function'}
{Alert body='Alert' options=['class' => 'alert-info']}
So without the # soju suggested.

yii-booster set up giving me errors

Sorry real new to yii, but where do i put the yii-booster 2.0 files?
I tried putting all the files into the extensions/bootstrap folder.
I then edited config/main.php and added this
'bootstrap' => array(
'class' => 'bootstrap.components.Bootstrap',
),
and
'preload'=>array(
'log',
// 'fontawesome',
'bootstrap',
),
and
'theme'=>'bootstrap',
where I have a theme in themes/bootstrap which I took from my previous installation of http://www.cniska.net/yii-bootstrap/
but I'm getting this error
Bootstrap and its behaviors do not have a method or closure named "register".
from the theme you got from http://www.cniska.net/yii-bootstrap/
try removing this in themes/bootstrap/views/layout/main.php
Yii::app()->bootstrap->register();

Prevent Yii from loading JS out of assets

Is there a way to configure Yii such that it will no longer load any Javascript out of the Assets folder?
Make your own AssetManager or extend current
protected/components/DummyAssetManager.php:
class DummyAssetManager extends CApplicationComponent {
public function publish(){}
}
add into components array in
protected/config/main.php:
'assetManager'=>array(
'class'=>'DummyAssetManager',
),
You should consult the manual for a detailed description of
the assetManager options
I think you can try following option in your config/main.php
'components' => array(
'assetManager' => array(
'linkAssets' => true,
),
),
This will make asset files symbolic links to your original js/css sources. See linkAssets for more details on it.
If your PHP<5.3, or the OS it's running on doesn't support symbolic links, you won't be able to use 'linkAssets' option, in this case you can try:
'components' => array(
'assetManager' => array(
'forceCopy' => true,
),
),
This should update asset folder on every request. These two options are usually used during development process (btw, you can't use both) and should be removed from production.
PS: if you're sure that you haven't explicitly enabled ckeditor somewhere in your code and you're confident about your assetmanager calls throughout the code, check your layout and page for widgets that require this CKeditor, as Yii can't preload 'stuff' just randomly, it can be triggered by some preloaded component/extension or yii widget.

enabling layout disables cjuidatepicker yii

I have a small view which renders cjuidatepicker widget.
$this->widget('zii.widgets.jui.CJuiDatePicker', array(
'flat'=>FALSE,
// 'model' => $model,
'attribute' => 'start_date',
// 'value' => $model->start_date,
'name'=>'dateSelect',
'options' => array(
'showButtonPanel' => true,
'changeYear' => true,
'dateFormat' => 'yy-mm-dd',
),
));?>
while this renders nicely without using a layout, but when I put this view in my project layout, the datepicker refuses to show up.
I have no ideas where to look for this, all the css and js are loading similarly in layout and without layout.
Any help would be greatly appreciated.
Thanks
Having dealt my fair share with the datepicker, I'm willing to bet money on that the root to your problem is an error in your javascript. Try to comment out all included javascript in your layout and see what happens. For example, maybe you have jQuery included twice, or some code section missing a closing bracket. Basically any js error will throw datepicker off it's game. Just check the js console in your favorite browser.
I had multiple versions of jquery being loaded and that created quite a mess. Yii jquery was different from the template jquery version being used. Brought both of them to an agreement and boom!!