初始值为零时,预先检查x-editable radiolist

时间:2015-04-28 18:00:44

标签: javascript jquery radio-button x-editable

我正在使用具有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'
    }]
});

0 个答案:

没有答案