본문으로 건너뛰기

syn.uicontrols.$select

select 태그에 통합되어 있는 단일 선택을 지원하는 컨트롤입니다. tail.select.js를 이용하여 개발됩니다.

<div>
<select id="ddlFileExtension" syn-options="{disabled: true,dataSourceID: 'CHP000', storeSourceID: 'MS001', parameters: '@GROUPCODE:MS001;', local: false, toSynControl: true, required: false}" style="width: 200px; height: 23px;"></select>
<select id="ddlBusinessRank" syn-options="{dataSourceID: 'CHP000', storeSourceID: 'MS002', parameters: '@GROUPCODE:MS002;', local: false, toSynControl: false, required: false}" style="width: 200px; height: 23px;"></select>
</div>
<hr />
<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="btnLoadData" value="loadData" syn-events="['click']" />
<input type="button" id="btnControlReload" value="controlReload" syn-events="['click']" />
<input type="button" id="btnSelectRowIndex" value="selectRowIndex" syn-events="['click']" />
<input type="button" id="btnGetSelectedIndex" value="getSelectedIndex" syn-events="['click']" />
<input type="button" id="btnSetSelectedIndex" value="setSelectedIndex" syn-events="['click']" />
<input type="button" id="btnGetSelectedValue" value="getSelectedValue" syn-events="['click']" />
<input type="button" id="btnGetSelectedText" value="getSelectedText" syn-events="['click']" />
<input type="button" id="btnSetSelectedValue" value="setSelectedValue" syn-events="['click']" />
<input type="button" id="btnSetSelectedText" value="setSelectedText" syn-events="['click']" />
<input type="button" id="btnGetControl" value="getControl" syn-events="['click']" />
<input type="button" id="btnDataRefresh" value="dataRefresh" syn-events="['click']" />
</div>
'use strict';
let $dropdownlist = {
config: {
programID: 'OMS',
businessID: 'SMP',
systemID: 'BOP01',
transactionID: 'SMP110',
screenID: 'dropdownlist',
dataSource: {
CMM001: {
CodeColumnID: 'CodeID',
ValueColumnID: 'CodeValue',
DataSource: [
{
CodeID: '0',
CodeValue: '권한없음'
},
{
CodeID: '1',
CodeValue: '권한존재'
}
]
},
CMM002: {
CodeColumnID: 'CodeID',
ValueColumnID: 'CodeValue',
DataSource: [
{
CodeID: '0',
CodeValue: '남자'
},
{
CodeID: '1',
CodeValue: '여자'
},
{
CodeID: '2',
CodeValue: '공개안함'
}
]
}
},
transactions: []
},

event: {
btnGetValue_click() {
syn.$l.eventLog('btnGetValue_click', JSON.stringify(syn.uicontrols.$select.getValue('ddlFileExtension')));
},

btnSetValue_click() {
syn.uicontrols.$select.setValue('ddlFileExtension', '02');
},

btnClear_click() {
syn.uicontrols.$select.clear('ddlFileExtension');
},

btnLoadData_click() {
var dataSource = {
CodeColumnID: 'CodeID',
ValueColumnID: 'CodeValue',
DataSource: [
{
CodeID: '0',
CodeValue: '남자'
},
{
CodeID: '1',
CodeValue: '여자'
},
{
CodeID: '2',
CodeValue: '공개안함'
}
]
};

syn.uicontrols.$select.loadData('ddlFileExtension', dataSource, true);
},

btnControlReload_click() {
syn.uicontrols.$select.controlReload('ddlFileExtension');
},

btnSelectRowIndex_click() {
syn.uicontrols.$select.selectRowIndex('ddlFileExtension', 3);
},

btnGetSelectedIndex_click() {
syn.$l.eventLog('btnGetSelectedIndex_click', syn.uicontrols.$select.getSelectedIndex('ddlFileExtension'));
},

btnSetSelectedIndex_click() {
syn.uicontrols.$select.setSelectedIndex('ddlFileExtension', 3);
},

btnGetSelectedValue_click() {
syn.$l.eventLog('btnGetSelectedValue_click', syn.uicontrols.$select.getSelectedValue('ddlFileExtension'));
},

btnGetSelectedText_click() {
syn.$l.eventLog('btnGetSelectedText_click', syn.uicontrols.$select.getSelectedText('ddlFileExtension'));
},

btnSetSelectedValue_click() {
syn.$l.eventLog('btnSetSelectedValue_click', syn.uicontrols.$select.setSelectedValue('ddlFileExtension', '1'));
},

btnSetSelectedText_click() {
syn.$l.eventLog('btnSetSelectedText_click', syn.uicontrols.$select.setSelectedText('ddlFileExtension', '초2'));
},

btnGetControl_click() {
var picker = syn.uicontrols.$select.getControl('ddlFileExtension');
},

btnDataRefresh_click() {
syn.uicontrols.$select.dataRefresh('ddlBusinessRank', {
dataSourceID: 'ZCB001',
parameters: '@CodeGroupID:CMM013;@CodeGroupID:CMM013;',
local: false,
toSynControl: false,
required: true,
selectedValue: '5'
}, function () {
alert('do....');
});
}
}
}