如何获取允许手动输入文本的ui-select元素的文本 [英] How can I take the text of the ui-select element which allows text to be enetered manually
问题描述
我有一个搜索功能,其中我有一个ui选择元素作为.net项目中的搜索过滤器,我正在使用角度JS。
这是一个自动提示控件。如果我选择下拉列表的某个值,它会被选中。
我们可以通过输入下拉控件来搜索其中的值(自动提示)。
我想要的是如果我没有从下拉列表中选择任何值,我希望选择在该控件中输入的文本。
总结一下,我希望选择值或在该控件中键入的文本。
部分代码:
I have a search functionality in which I have a ui select element as a search filter in a .net project with which I am using angular JS.
It is an autosuggestion control. If I select some value of the dropdown, it gets selected.
We can search the value in it(autosuggestion) by typing in the dropdown control.
What I want is if I do not select any value from the dropdown, I want the text entered in that control to be selected.
To summarize, I want the value to be selected or the text, typed in that control.
the Part of the code:
<ui-select id="wrkshpTitle" ng-model="wrkshpTitles.selectedWrkshpTitle"
ng-keyup="hn($select)"ng-disabled="disabled">
<ui-select-match placeholder="No Filter">
{{$select.selected.OfferingNme}}"<"/ui-select-match>
<ui-select-choices when-scrolled="loadMoreRecords()" percent="70"
repeat="title in wrkshpTitles|filter: $select.search">
<span ng-bind-html="title.OfferingNme|highlight: $select.search">
</ui-select-choices>
</ui-select>
我在这里使用了额外的以便我可以在这里粘贴html代码。
我的尝试:
我已成功实施了下拉并使用stackoverflow和其他东西的建议但没有帮助。
I have used here extra "" so that I could paste the html code here.
What I have tried:
I have successfully implemented the dropdown and used the suggestions of stackoverflow and other things but to no help.
推荐答案
select)ng-disabled =disabled>
< ui-select-match placeholder =No Filter>
{{
select)"ng-disabled="disabled"> <ui-select-match placeholder="No Filter"> {{
select.selected.OfferingNme}}</ ui-select-match>
< ui-select-choices when-scrolled =loadMoreRecords()percent =70
repeat =wrkshpTitles中的标题|过滤器:
select.selected.OfferingNme}}"<"/ui-select-match> <ui-select-choices when-scrolled="loadMoreRecords()" percent="70" repeat="title in wrkshpTitles|filter:
select.search >
< span ng-bind-html =title.OfferingNme | highlight:
select.search"> <span ng-bind-html="title.OfferingNme|highlight:
这篇关于如何获取允许手动输入文本的ui-select元素的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!