dijit.form.FilteringSelect使用子字符串搜索 [英] dijit.form.FilteringSelect with substring search
问题描述
dijit.form.FilteringSelect靠近我所需要的。我已经尝试了很多方法来做我想做的事情,但是作为一个dijit初学者,我从来不知道我是否走向正确的方向。
dijit.form.FilteringSelect is close to what I need. I've tried lots of ways to do what I want, but being a dijit beginner I never know if I'm even going in the right direction.
当我开始输入FilteringSelect,我只看到从我输入的内容开始的选项。像 value +*
上的查询一样
我需要的是看到任何可以在任何地方输入的任何选项。像*+ value +*
When I start typing in a FilteringSelect, I only see the options starting with what I typed. Like a query on value + "*"
What I need is to see any option that has what I type anywhere. Like a query on "*" + value + "*"
中的查询,所以如果有苹果,香蕉和橙,我键入e,我应该看到苹果和橙。如果可能,强调搜索字符串:应用 e ,Orang e
So if there is "Apple", "Banana" and "Orange", and I type "e", I should see "Apple" and "Orange". If possible, with the search string emphasized: "Apple", "Orange"
我想我需要一些聪明的数据存储,但我去的任何地方看起来像一个死胡同。我错过了一些东西,还是应该以完全不同的方式来做?
I think I need some clever data storage, but anywhere I go looks like a dead end. Am I missing something, or should I do this in a completely different way?
推荐答案
你想使用 queryExpr
属性:
var f = new dijit.form.FilteringSelect({
...
queryExpr: "*${0}*",
...
}, node);
注意$ {0}前后的*。
Notice the * before and after the ${0}.
这篇关于dijit.form.FilteringSelect使用子字符串搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!