Opened 7 years ago

Closed 6 years ago

#17079 closed enhancement (invalid)

dojox/mobile/FilteredListMixin should accept all SearchBox configurations

Reported by: nonplus Owned by: Adrian Vasiliu
Priority: undecided Milestone: tbd
Component: DojoX Mobile Version: 1.9.0rc2
Keywords: Cc:
Blocked By: Blocking:

Description

As a user of the dojox/mobile/FilteredListMixin widget, I would expect that any SearchBox? settings I specify in my template would be applied to the SearchBox? widget that's created by the mixin.

However, currently only the TextBox? placeHolder setting is applied.

I should be able to specify the _SearchMixin properties declaratively. For example queryExpr, searchAttr and searchDelay.

My current workaround is to specify them in code.

Template example:

<div data-dojo-type="dojox/mobile/View">
	<h1 data-dojo-type="dojox/mobile/Heading" data-dojo-props="fixed: 'top'">Fruits</h1>
	<input data-dojo-type="dojox/mobile/SearchBox" type="search" id="filterBox"
		class="mblFilteredEdgeToEdgeListSearchBox">
	<div data-dojo-type="dojox/mobile/ScrollableView">
		<ul data-dojo-type="dojox/mobile/EdgeToEdgeStoreList"
			data-dojo-mixins="dojox/mobile/FilteredListMixin"
			data-dojo-props="store: store, searchAttr: 'search', queryExpr='*${0}*'"></ul>
	</div>
</div>

Change History (5)

comment:1 Changed 7 years ago by bill

Component: GeneralDojoX Mobile
Owner: set to Eric Durocher

comment:2 Changed 7 years ago by Patrick Ruzand

Owner: changed from Eric Durocher to Patrick Ruzand
Status: newassigned

comment:3 Changed 6 years ago by Adrian Vasiliu

This is already possible. As documented, the dojox/mobile/SearchBox can also be defined distinctly in markup while associating it with the FilteredListMixin?. See an example in dojox/mobile/tests/test_FilteredList-EdgeToEdgeStoreList?-simple.html:

<input data-dojo-type="dojox/mobile/SearchBox" type="search" 
  id="filterBox" class="mblFilteredEdgeToEdgeListSearchBox">
<div data-dojo-type="dojox/mobile/ScrollableView">
  <ul data-dojo-type="dojox/mobile/EdgeToEdgeStoreList"
    data-dojo-mixins="dojox/mobile/FilteredListMixin"
    data-dojo-props="filterBoxRef: 'filterBox', placeHolder: 'Search', store: store"></ul>
</div>

Thus, since dojox/mobile/SearchBox extends dijit/form/_SearchMixin, you can specify declaratively any property of _SearchMixin.

The ability to define (optionally) the SearchBox? separately from the FilteredListMixin? has been designed precisely to allow more advanced customization in a lighter and saner way than duplicated all SearchBox/SearchMixin? properties on the FilteredListMixin?.

Does this answer your need?

comment:4 Changed 6 years ago by Adrian Vasiliu

Owner: changed from Patrick Ruzand to Adrian Vasiliu

comment:5 Changed 6 years ago by Patrick Ruzand

Resolution: invalid
Status: assignedclosed

To my understanding from Adrian's comment, the current API does answer the use case. Closing it.

Note: See TracTickets for help on using tickets.