我正在使用具有x-editable的radiolist。如果初始值不为零(例如1
),则x可编辑对话框预先检查单选按钮,但如果初始值为零则不是这种情况。可能最好只查看https://jsfiddle.net/1330379z/1/。有谁知道怎么做?
<p>Start with Yes</p><a href="javascript:void(0)" class="radio" data-value="1"></a>
<br>
<p>Start with No</p><a href="javascript:void(0)" class="radio" data-value="0"></a>
<br>One
<input type="radio" name="test" value="1">
<br>
Zero<input type="radio" name="test" value="0">
$('.radio').editable({
type: 'radiolist',
title: "Select yes or no",
source: [{
value: 0,
text: 'No'
}, {
value: 1,
text: 'Yes'
}]
});