简体   繁体   English

文本框列出jQuery移动文本框

[英]Text Box List a jQuery mobile textbox

I am building a custom jQuery Mobile auto-complete input box (ie no using a plugin) and I want to use a text box list (ie display non-text elements inside the text field, see tagging in the Facebook text box for an example). 我正在构建一个自定义jQuery Mobile自动完成输入框(即不使用插件),并且我想使用一个文本框列表(即在文本字段内显示非文本元素,请参阅Facebook文本框中的标记示例) )。 I haven't been able to find any resources on how to approach this. 我还没有找到任何有关如何解决此问题的资源。 Can anyone point me toward something on how to display non-text elements in a jQuery Mobile input box? 谁能指出我关于如何在jQuery Mobile输入框中显示非文本元素的信息?

You can put pictures in the listview format, would something like autocomplete displaying a listview of items to choose from with the pictures there work ? 您可以将图片以listview格式放置,像自动完成功能那样显示要从中选择图片的项目的listview吗? also jquery mobile listview has an automatic search bar which dynamically filters results built in already: jQuery mobile listview还具有自动搜索栏,该搜索栏可动态过滤内置的结果:

Here's the link on all the types of listview possible: 这是所有可能的列表视图类型的链接:

Jquery-Mobile Listview jQuery移动列表视图

Hope this helps ! 希望这可以帮助 !

In response to your comment It seems that the autocomplete suggestions have to be stored in an array, this can probably be dynamically filled though some request or I you know what the data will be just hard code the suggestions in like this from the jquery ui site: 回应您的评论似乎必须将自动完成建议存储在数组中,尽管有些请求可以动态填充该建议,或者我知道数据将只是硬编码,但这些建议来自jquery ui网站:

 <script>
        $(function() {
            var availableTags = [
                "ActionScript",
                "AppleScript",
                "Asp",
                "BASIC",
                "C",
                "C++",
                "Clojure",
                "COBOL",
                "ColdFusion",
                "Erlang",
                "Fortran",
                "Groovy",
                "Haskell",
                "Java",
                "JavaScript",
                "Lisp",
                "Perl",
                "PHP",
                "Python",
                "Ruby",
                "Scala",
                "Scheme"
            ];
            $( "#tags" ).autocomplete({
                source: availableTags
            });
        });
        </script>



    <div class="demo">

    <div class="ui-widget">
        <label for="tags">Tags: </label>
        <input id="tags">
    </div>

    </div><!-- End demo -->



<div class="demo-description" style="display: none; ">
<p>The Autocomplete widgets provides suggestions while you type into the field. Here the suggestions are tags for programming languages, give "ja" (for Java or JavaScript) a try.</p>
<p>The datasource is a simple JavaScript array, provided to the widget using the source-option.</p>
</div><!-- End demo-description -->

does this help ? 这有帮助吗? you can see more on it here: http://jqueryui.com/demos/autocomplete/ 您可以在此处查看更多信息: http : //jqueryui.com/demos/autocomplete/

Sorry to bog you down with the lengthy answer but also the autocomplete can be enhanced to take in pictures see here: http://jqueryui.com/demos/autocomplete/#custom-data which I think could be along the lines of what you're looking for. 抱歉,冗长的答案使您失望,但也可以增强自动完成功能以拍摄照片,请参见此处: http : //jqueryui.com/demos/autocomplete/#custom-data ,我认为这可能与您的想法相似正在寻找。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM