Materializecss Autocomplete does not create a drop down list?

connects to the header
$this->registerJsFile('/frontend/web/js/custom/search/liveSearch.js', ['position' => yii\web\View::POS_END]);

 public $baseUrl = '/frontend/web';
 public $css = [
'css/style.css?rel=15344239348633',
'css/custom.css?rel=1534423934859',
'css/chat.css?rel=7',
];
 public $js = [
'js/timeago/timeago.js',
 'js/vendor.js?rel=1534423934865', //materualize in the Assembly
'js/script.js?rel=1534423934880',
'js/custom/custom.js?rel=1534423934860',
];
 public $depends = [
'yii\web\YiiAsset',
'yii\web\JqueryAsset'
/*'yii\bootstrap\BootstrapAsset',*/
 ];

In the end, displays this error this.dropdownEl is null;
$(function () {
 $('#search').autocomplete({data: {"apple":null, "appstore":null, "appetize":null}});
console.log(1);
});
March 19th 20 at 08:49
1 answer
March 19th 20 at 08:51
1. what's yii? The issue in the context of js.
2. in what file and what a mistake this.dropdownEl is null;?
3. try povangovat. You have no element with an id of "search", check this:
$(function () {
 var myEl = $('#search');
console.log(myEl.length);
});
@keshawn.Grimes, search is. The problem is yii, because separately in the file layout works, but in yii not. - jaida commented on March 19th 20 at 08:54
@jaida,
the problem is yii because separately file with layout in yii not working

??? Read five times, did not understand. - keshawn.Grimes commented on March 19th 20 at 08:57
@jaida, problems in yii there. there is a problem with the incorrect use yii =) - Aryanna_Schuster commented on March 19th 20 at 09:00

Find more questions by tags JavaScript