问题
I want to sort dojox mobile ListItem
by label alphabetically. The label in my DOM looks like:
<div class="subject">Sort alphabetically against me only</div>
<span class="bomtype"> don't sort against me. </span>
I want to sort by the text in the label having class="subject"
in ascending order. I am using Dojo 1.9.1.
回答1:
You can use dojox/mobile/EdgeToEdgeStoreList or dojox/mobile/RoundRectStoreList, for instance:
<ul data-dojo-type="dojox/mobile/EdgeToEdgeStoreList"
data-dojo-props='store: store, query:{}, queryOptions: {sort: [{attribute: "label", descending: true}]}'></ul>
Note that, as documented, EdgeToEdgeDataList and RoundRectData list are deprecated in Dojo 1.9.
来源:https://stackoverflow.com/questions/19114247/sorting-dojox-mobile-listitem-against-label