JQM:是否可以将控制组放入可折叠的栏中而不传播单击事件?
问题描述:
我的真正愿望是为JQM创建一个可选树(每个元素有3个值)。我试图用嵌套的可折叠的分区,这工作正常。但是,当我试图在每个可折叠酒吧上添加3个收音机时,事件不会正确启动。JQM:是否可以将控制组放入可折叠的栏中而不传播单击事件?
我认为collapse/expand事件挂钩收音机的点击事件。效果是,当您单击收音机时,可折叠展开并且收音机未被选中。
<div data-role="collapsible" data-theme="b" data-content-theme="d" id="accordion1">
<h3>60
<fieldset data-role="controlgroup" data-type="horizontal" data-mini="true" >
<input type="radio" name="selcrit-CLP-60" id="selcrit-CLP-60-asign" value="60-asign">
<label for="selcrit-CLP-60-asign">Asign</label>
<input type="radio" name="selcrit-CLP-60" id="selcrit-CLP-60-omit" value="60-omit">
<label for="selcrit-CLP-60-omit">Omit</label>
<input type="radio" name="selcrit-CLP-60" id="selcrit-CLP-60-nothing" value="60-nothing">
<label for="selcrit-CLP-60-nothing">Nothing</label>
</fieldset>
</h3>
<div stylee="margin: 0 10px;">
Content for 60
</div>
下面是该示例中的jsfiddle:http://jsfiddle.net/Hz8Ef/
任何想法?我能以其他方式做吗? 在此先感谢
答
解决!
$(document).ready(function() {
$("div .ui-radio").click(
function(e){
var radioId = $(this).children(":first").attr('name');
$('input[name=' + radioId + ']').checkboxradio("refresh");
e.stopPropagation();
}
);
});
这里完整的解决方案:http://jsfiddle.net/VuaQg/1/