0

我必须创建一个带有单选按钮的动态列表视图。

我能够创建如下的动态列表视图

HTML

<div data-role="page" id="storedlist" >
    <div data-role="header" >
        <h1>Dynamic listview</h1>
        <a href="#"/></a>

    </div>
    <div data-role="content">
        <ul id="storedList">
        </ul>
    </div>
</div>

在我的 .js 文件中,我会将列表元素附加到 ul,如下所示

JS

$('#storedList').append('<li ><a href="#">'+row["nname"]+'</a></li>');

以上将为我提供动态列表视图。

我将如何将单选按钮添加到动态列表视图?

还是我们可以通过单选按钮创建动态列表视图的任何其他方式?

谢谢:)

4

1 回答 1

0

Work out how you would code the radiobuttons statically, and then use something similar to what you did for each list item to add the radiobuttons dynamically instead. Since you haven't spelled out details about those buttons, can't go into much more detail than that. (For example, you'll probably want a button group, and could append your individual buttons into that.)

于 2013-05-17T14:25:11.087 回答