Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple split buttons on jQuery Mobile list

Is it possible to have multiple split buttons in a jQuery mobile list?

I've tried doing this:

<ul data-role='listview'>
    <li>
        <a href='#' id='1'>1</a>
        <a href='#' id='btn1'></a>
        <a href='#' id='btn2'></a>
    </li>
</ul>

But it doesn't work. Neither does wrapping the links in a <div data-role='controlgroup>. Am I doing something wrong, or is it just not possible without a hack?

UPDATE: The list is dynamically generated by doing $("#listid).append("<li>...</li>"). http://jsfiddle.net/nrpMN/3/ . As pointed out by mdmullinax below, the following does work:

<ul data-role='listview'>
    <li>
       <a href='#' id='1'>1</a>
        <div data-role='controlgroup' data-type='horizontal'>
            <a href='#' id='btn1'></a>
            <a href='#' id='btn2'></a>
        </div>
    </li>
</ul>

Thanks

like image 507
Jay Avatar asked Oct 24 '22 03:10

Jay


1 Answers

Sounds like what you want is a horizontal controlgroup nested in a listview.

http://jsfiddle.net/nrpMN/

<ul data-role='listview'>
    <li>
        <div data-role="controlgroup" data-type="horizontal">
            <a href="index.html" data-role="button">Yes</a>
            <a href="index.html" data-role="button">No</a>
            <a href="index.html" data-role="button">Maybe</a>
        </div>
    </li>
</ul>
like image 73
MikeM Avatar answered Nov 02 '22 14:11

MikeM