userCtrl.sort(..), onSort(..) 적용

dev^2
mjkhan21 4 months ago
parent 5e35864e8f
commit 8fe9ce445f

@ -24,8 +24,8 @@
<table class="datatables-ajax table table-bordered dataTable no-footer"> <table class="datatables-ajax table table-bordered dataTable no-footer">
<thead name="userThead"> <thead name="userThead">
<tr><th tabindex="0" style="width: 158.828px; text-align:center;"><input onchange="userCtrl.select(this.checked);" type="checkbox" class="form-check-input"></th> <tr><th tabindex="0" style="width: 158.828px; text-align:center;"><input onchange="userCtrl.select(this.checked);" type="checkbox" class="form-check-input"></th>
<th class="sorting sorting_asc" aria-sort="ascending" style="width: 223.719px;">계정</th> <th onclick="userCtrl.sort(this.getAttribute('data-field'));" data-field="USER_ACNT" class="sorting" style="width: 223.719px;">계정</th>
<th class="sorting" style="width: 146.156px;">이름</th> <th onclick="userCtrl.sort(this.getAttribute('data-field'));" data-field="USER_NM" class="sorting" style="width: 146.156px;">이름</th>
<th class="sorting" style="width: 195.688px;">이메일</th> <th class="sorting" style="width: 195.688px;">이메일</th>
<th class="sorting" style="width: 160.141px;">전화번호(무선)</th> <th class="sorting" style="width: 160.141px;">전화번호(무선)</th>
<th class="sorting" style="width: 230.469px;">등록일자</th> <th class="sorting" style="width: 230.469px;">등록일자</th>
@ -106,6 +106,12 @@ userCtrl.onDatasetChange = obj => {
}); });
}; };
userCtrl.onSort = sorter => {
userCtrl.renderList();
sorting.setHeaders(userCtrl.querySelectorAll("th[data-field]"), sorter);
};
userCtrl.onCurrentChange = item => { userCtrl.onCurrentChange = item => {
if (!item) return; if (!item) return;

Loading…
Cancel
Save