FimsFormFields.get 수정

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

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

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