我正在尝试使用tinysort根据数据属性对列表进行排序。
首先是列表:
<ul id="late-services" class="list">
<li data-service-id="23" data-criticality="1000">
<span>Service 23</span>
<span class="list-collapse ui-icon ui-icon-carat-1-s"></span>
<span class="service-zone">Cannes</span>
<div class="list-item-belly" style="display: none;">
<div>Deadline dans 1 semaine.</div>
<div>Le client n'a pas confirmé.</div>
</div>
</li>
<li data-service-id="22" data-criticality="2000">
<span>Service 22</span>
<span class="list-collapse ui-icon ui-icon-carat-1-s"></span>
<span class="service-zone">Cannes</span>
<div class="list-item-belly" style="display: none;">
<div>Deadline dans 1 semaine.</div>
<div>Le client n'a pas confirmé.</div>
</div>
</li>
<li data-service-id="24" data-criticality="500">
<span>Service 24</span>
<span class="list-collapse ui-icon ui-icon-carat-1-s"></span>
<span class="service-zone">Cannes</span>
<div class="list-item-belly" style="display: none;">
<div>Deadline dans 1 semaine.</div>
<div>Le client n'a pas confirmé.</div>
</div>
</li>
</ul>
然后调用 tinysort:
$('ul#late-services>li').tsort('li', {data:'serviceId'});
我一定是做错了什么,但不知道是什么...