jQuery mobile 1.2.0 Alpha 1 autodividersSelector

孤街浪徒 提交于 2019-12-13 06:00:59

问题


I'm trying to divide a jQuery mobile list depending on an attribute in each li element.

$("#mylistview").listview({
    autodividers: true,
    autodividersSelector: function ( li ) {
        var out = $('li').attr('attr_name');
        return out;
    }
});

But it creates the list divider only for the 1st list item attribute. I'm using listview(refresh) each time I insert a new li.

What I don't understand is if I need to call the function I pasted here before creating the list, after or for each element. I think I've tried each of those but maybe I'm not doing it right.

Is that because the 1.2.0 is still alpha? I thought this function was working now http://jquerymobile.com/test/docs/lists/docs-lists.html

Thanks to whoever will be able/willing to answer.


回答1:


My fault: the right code is

$("#mylistview").listview({
    autodividers: true,
    autodividersSelector: function ( li ) {
        var out = li.attr('attr_name'); //HERE THE CHANGE
        return out;
    }
});

Thanks anyway for the reply.



来源:https://stackoverflow.com/questions/12693706/jquery-mobile-1-2-0-alpha-1-autodividersselector

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!