userCtrl 메소드 동기화

main
mjkhan21 3 months ago
parent bc9e4c30ad
commit f2bb0cb6cc

@ -7,7 +7,7 @@
<div class="d-flex flex-row justify-content-between p-3"> <div class="d-flex flex-row justify-content-between p-3">
<div class="d-flex flex-grow-1 me-5"> <div class="d-flex flex-grow-1 me-5">
<div class="input-group me-3 w-px-400"> <div class="input-group me-3 w-px-400">
<select name="by" onchange="userCtrl.find('term').focus();" class="form-select"> <select name="by" onchange="userCtrl.find('name', 'term').focus();" class="form-select">
<option value="userName">이름</option> <option value="userName">이름</option>
<option value="userAccount">계정</option> <option value="userAccount">계정</option>
</select> </select>
@ -86,10 +86,10 @@ var userCtrl = newUserControl();
userCtrl.search = () => { userCtrl.search = () => {
userCtrl.query = { userCtrl.query = {
by: userCtrl.find("by").value, by: userCtrl.find('name', "by").value,
term: userCtrl.find("term").value, term: userCtrl.find('name', "term").value,
status: userCtrl.find("status").value, status: userCtrl.find('name', "status").value,
type: userCtrl.find("type").value, type: userCtrl.find('name', "type").value,
}; };
if(userCtrl.query.by == "userAccount"){ if(userCtrl.query.by == "userAccount"){
@ -115,13 +115,13 @@ userCtrl.renderList = () => {
let trs = empty ? let trs = empty ?
[document.getElementById("userNotFound").innerHTML] : <%-- from template#userNotFound --%> [document.getElementById("userNotFound").innerHTML] : <%-- from template#userNotFound --%>
userList.inStrings( userList.inStrings(
userCtrl.find("userRow").innerHTML, <%-- from template#userRow --%> userCtrl.find('name', "userRow").innerHTML, <%-- from template#userRow --%>
(str, dataItem) => str (str, dataItem) => str
.replace(/{onclick}=""/gi, 'onclick="userCtrl.setCurrent(\'' + dataItem.getValue("USER_ID") + '\');"') .replace(/{onclick}=""/gi, 'onclick="userCtrl.setCurrent(\'' + dataItem.getValue("USER_ID") + '\');"')
.replace(/{ondblclick}=""/gi, 'ondblclick="userCtrl.getInfo(\'' + dataItem.getValue("USER_ID") + '\')"') .replace(/{ondblclick}=""/gi, 'ondblclick="userCtrl.getInfo(\'' + dataItem.getValue("USER_ID") + '\')"')
); );
userCtrl.find("userList").innerHTML = trs.join(""); userCtrl.find('name', "userList").innerHTML = trs.join("");
userCtrl.querySelector("[name='userThead'] th input[type='checkbox']").checked = false; userCtrl.find("[name='userThead'] th input[type='checkbox']").checked = false;
} }
userCtrl.onDatasetChange = obj => { userCtrl.onDatasetChange = obj => {
@ -148,12 +148,12 @@ userCtrl.onSelectionChange = selected => {
let userList = userCtrl.dataset; let userList = userCtrl.dataset;
let keys = selected.map(e => userList.getKey(e)); let keys = selected.map(e => userList.getKey(e));
userCtrl.querySelectorAll("[name='userList'] input[type='checkbox']") userCtrl.findAll("[name='userList'] input[type='checkbox']")
.forEach(node => { .forEach(node => {
node.checked = keys.includes(node.value); node.checked = keys.includes(node.value);
}); });
userCtrl.querySelectorAll(".enable-onfound") userCtrl.findAll(".enable-onfound")
.forEach(node => { .forEach(node => {
node.disabled = keys.length < 1; node.disabled = keys.length < 1;
}); });

Loading…
Cancel
Save