betelgeuse
betelgeuse

Reputation: 160

Dojo Mobile filter long item list

I'm using Dojo mobile to build a very simple mobile app which consists of a simple list with more than 500 items with the possibility to filter items.

It's a simple requirement but it seems that it cannot be done with Dojo mobile using existing widgets.

My idea was to use EdgeToEdgeList mixed with LongListMixin and FilteredListMixin but it doesn't work.

How can i accomplish this simple task, have a list with many items that can be filtered with Dojo mobile?

I have to build all from scratch using _TemplatedMixin and the template system? :(

Thank you.

Francesco.

Upvotes: 0

Views: 213

Answers (2)

tik27
tik27

Reputation: 2698

I know this is an old question, but recently ran into the same situation. I have found that this does work in version 1.9 of dojo. I created a widget using both the filter and long list mixin and found them to work together. If you look at the fiddle, you will see the first 20 ListItems are created, then as you scroll another 20 are added at a time.

<div data-dojo-type="dojox/mobile/ScrollableView">
 <h1 data-dojo-type="dojox/mobile/Heading" data-dojo-props="fixed: 'top'">Heading</h1>
<input  id="accountSearchInput" 
 data-dojo-type="dojox/mobile/SearchBox" 
 type="search" data-dojo-props="queryExpr: '*${0}*'">

<ul id="searchList2" data-dojo-type="dojox/mobile/RoundRectStoreList"  
 data-dojo-mixins="dojox/mobile/LongListMixin,dojox/mobile/FilteredListMixin"
 class="accountMainList" 
 data-dojo-props='select:"single",store:accountSwitch.childAccounts,itemMap:{accountName:"label", accountId:"id"},filterBoxRef:"accountSearchInput",labelProperty:"accountName"'>
 </ul>
 </div>

fiddle:http://jsfiddle.net/theinnkeeper/Lrza3nqs/

Upvotes: 1

edchat
edchat

Reputation: 321

You may want to take a look at this tutorial, even if you don't want to use dojox/app, this can show you how to use a dojox/mobile/EdgeToEdgeStoreList with a dojox/mobile/FilteredListMixin

https://dojotoolkit.org/documentation/tutorials/1.9/dojox_app/contactsList/

Regards, Ed

Upvotes: 0

Related Questions