Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django jQueryUI自动完成建议显示在输入字段外部_Django_Jquery Ui_Autocomplete - Fatal编程技术网

Django jQueryUI自动完成建议显示在输入字段外部

Django jQueryUI自动完成建议显示在输入字段外部,django,jquery-ui,autocomplete,Django,Jquery Ui,Autocomplete,我已经在Django项目中使用jQueryUi设置了一个自动完成表单 自动完成工作正常。问题是,建议不会显示在我的表单下,而是显示在屏幕的右侧 我需要的建议,以出现在我的搜索字段下,因为它应该和显示只有10个第一产品匹配我的搜索 我的HTML: <div class="ui-widget"> <input id="prod" class="form-control mr-sm-2" type="text&

我已经在Django项目中使用jQueryUi设置了一个自动完成表单

自动完成工作正常。问题是,建议不会显示在我的表单下,而是显示在屏幕的右侧

我需要的建议,以出现在我的搜索字段下,因为它应该和显示只有10个第一产品匹配我的搜索

我的HTML:

<div class="ui-widget">
 <input id="prod" class="form-control mr-sm-2" type="text" name="query" placeholder="">
</div>
My views.py:

$(function() {
    $("#prod").autocomplete({     
     source: "/finder/search_auto",
     select: function (event, ui) { 
        AutoCompleteSelectHandler(event, ui)
      },
      minLength: 2,
    });
  });$( "#prod" ).autocomplete({
    position: { my : "right top", at: "right bottom" }
    });

function AutoCompleteSelectHandler(event, ui)
  {
    var selectedObj = ui.item;
  }

使用最新版本更新它:

<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>


这应该就够了。

你有没有加入JqueryUI CSS?我说:
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>