deleteAll uses checkedRows getter now
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
bf386929d3
commit
e4fe125627
|
@ -60,20 +60,23 @@ export default class SmartTable extends Component {
|
|||
return criteria.field == field;
|
||||
});
|
||||
|
||||
const isASC = existingCriteria && existingCriteria.sortType == 'ASC';
|
||||
const isDESC = existingCriteria && existingCriteria.sortType == 'DESC';
|
||||
|
||||
if (!existingCriteria) {
|
||||
this.sortCriteria.push({field: field, sortType: 'ASC'});
|
||||
element.classList.remove('desc');
|
||||
element.classList.add('asc');
|
||||
}
|
||||
|
||||
if (existingCriteria && existingCriteria.sortType == 'DESC') {
|
||||
if (isDESC) {
|
||||
this.sortCriteria.splice(this.sortCriteria.findIndex(criteria => {
|
||||
return criteria.field == field;
|
||||
}), 1);
|
||||
element.classList.remove('desc');
|
||||
element.classList.remove('asc');
|
||||
}
|
||||
if (existingCriteria && existingCriteria.sortType == 'ASC') {
|
||||
if (isASC) {
|
||||
existingCriteria.sortType = 'DESC';
|
||||
element.classList.remove('asc');
|
||||
element.classList.add('desc');
|
||||
|
@ -99,8 +102,8 @@ export default class SmartTable extends Component {
|
|||
}
|
||||
|
||||
deleteAll() {
|
||||
const rowsChecked = this.checkedRows();
|
||||
for (let row of rowsChecked)
|
||||
const checkedRows = this.checkedRows;
|
||||
for (let row of checkedRows)
|
||||
this.model.removeRow(row);
|
||||
|
||||
if (this.autoSave)
|
||||
|
|
Loading…
Reference in New Issue