I have a list but when I try to generate autodividers for that list I'm getting duplicate dividers. Here is the code for the ul and the relevant script:
<div data-role="content">
<ul data-role="listview" id="ScheduleList" data-autodividers="true">
<li time="3:30PM"><a href="#">Event 1</a></li>
<li time="3:30PM"><a href="#">Event 2</a></li>
<li time="4:30PM"><a href="#">Event 3</a></li>
<li time="3:30PM"><a href="#">Event 4</a></li>
<li time="3:30PM"><a href="#">Event 5</a></li>
<li time="4:30PM"><a href="#">Event 6</a></li>
</ul>
</div>
</div>
<script>
$(document).on("pageinit", "#ScheduleDay", function(){
$("#ScheduleList").listview({
autodividers: true,
autodividersSelector: function (li) {
var out = li.attr('time');
return out;
}
}).listview('refresh');
});
</script>
Here is the code in JSFiddle: http://jsfiddle.net/4fGT6/65/
I know that I could reorder the list items in the html and that would eliminate the duplicate autodividers, but if I made the list to be generated dynamically from user inputs then I couldn't manually reorder the html.
Is there a way to solve this if the list had been generated dynamically?
Thanks.