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

Loading…
Cancel
Save