开发者

Dojo filteringSelect query expression

I'm using the dojo filtering select widget. I'm trying to customize the queryExpr. According to all forums/documentation, there are 4 types of expressions: - ${0} - find exact expression - ${0} - conta开发者_如何转开发ins - ${0}* - starts with - *${0} - ends with

I'm trying to accomplish an auto-completion where any word starts with the typed in string. For example:

if I type "expr" the following suggestion will pop up "some expression".

The contains expression doesn't really do the job, because I don't want that suggestion to appear if I type "press" for example.

Does the queryExpr attribute accept regular expressions? If not, is there any way of achieving this?

Thank you!


The auto-completion functionality in dijit.form.FilteringSelect is derived from dijit.form.ComboBox.

You could extend dijit.form.ComboBox, override the _autoCompleteText() function, providing your custom implementation.

Finally, you could then create your own custom filtering select control that inherited from your custom combo box instead of the ComboBox.

Writing Custom Widgets Quickstart Guide


The functionality explained in the question is available for diji.form.FilteringSelect widget by default. The 'contains' is not checked for, rather it is checked for the matches from the beginning of the text as expected by you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜