FimsFormFields.get 수정

main
이범준 3 months ago
parent 69169557f0
commit 810886d11d

@ -101,48 +101,53 @@ class FimsFormFields extends FormFields {
get() {
let obj = {};
document.querySelectorAll(this.children).forEach(input => {
let property = input.name || input.id;
let value = input.value;
if("radio" == input.type) {
if(input.checked)
obj[property] = value;
} else if("checkbox" == input.type) {
if(input.checked){
if(obj[property]){
obj[property] += ","+value;
} else {
obj[property] = value;
if(input.tagName == "INPUT" || input.tagName == "SELECT" || input.tagName == "TEXTAREA"){
let property = input.name || input.id;
let value = input.value;
if("radio" == input.type) {
if(input.checked)
obj[property] = value;
} else if("checkbox" == input.type) {
if(input.checked){
if(obj[property]){
obj[property] += ","+value;
} else {
obj[property] = value;
}
}
}
} else {
if(input.dataset.fmtType){
const fmtType = input.dataset.fmtType;
switch (fmtType) {
case 'dt' :
value = value.replaceAll("-","").replaceAll(":","").replaceAll(" ","");
break;
case 'day' :
value = value.replaceAll("-","");
break;
case 'time' :
value = value.replaceAll(":","");
break;
case 'number' :
value = value.replaceAll(",","");
break;
default:
break;
}
}
obj[property] = value;
}
} else {
if(input.dataset.fmtType){
const fmtType = input.dataset.fmtType;
switch (fmtType) {
case 'dt' :
value = value.replaceAll("-","").replaceAll(":","").replaceAll(" ","");
break;
case 'day' :
value = value.replaceAll("-","");
break;
case 'time' :
value = value.replaceAll(":","");
break;
case 'number' :
value = value.replaceAll(",","");
break;
default:
break;
}
}
obj[property] = value;
}
}
});
return obj;
}
}
function newFimsFormFields(conf){
return new FimsFormFields(conf);
}
/**************************************************************************
* data-doctx,name 어트리뷰트로 찾기
**************************************************************************/

@ -563,4 +563,8 @@ class FimsPagingSupport extends PagingSupport {
$(this.doq.selector(this.linkContainer)).setPagingInfo(pagination);
}
}
function newFimsPagingSupport(conf){
return new FimsPagingSupport(conf);
}
Loading…
Cancel
Save