본문으로 건너뛰기

syn.uicontrols.$checkbox

<div>
<div>예시</div>
<input id="chkUseYN1" type="checkbox" syn-datafield="UseYN1" value="custom value 1" checked="checked" syn-options="{textContent: '사용여부', toSynControl: false}">
<input id="chkUseYN2" type="checkbox" syn-datafield="UseYN2" value="custom value 2" syn-options="{textContent: '사용여부', toSynControl: true}">
</div>
<hr />
<div>
<div>기능</div>
<input type="button" id="btnGetValue" value="getValue" syn-events="['click']" />
<input type="button" id="btnSetValue" value="setValue" syn-events="['click']" />
<input type="button" id="btnClear" value="clear" syn-events="['click']" />
<input type="button" id="btnToggleValue" value="toggleValue" syn-events="['click']" />
</div>
'use strict';
let $checkbox = {
event: {
btnGetValue_click() {
syn.$l.eventLog('btnGetValue_click', JSON.stringify(syn.uicontrols.$checkbox.getValue('chkUseYN1')));
},

btnSetValue_click() {
syn.uicontrols.$checkbox.setValue('chkUseYN1', true);
},

btnClear_click() {
syn.uicontrols.$checkbox.clear('chkUseYN1');
},

btnToggleValue_click() {
syn.uicontrols.$checkbox.toggleValue('chkUseYN2');
}
}
}