refs #5410 fix: se mantenien los checkbox marcados al paginar
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
4e0567eb0c
commit
38bf49c0b6
|
@ -5,6 +5,7 @@
|
||||||
limit="20"
|
limit="20"
|
||||||
order="amount DESC"
|
order="amount DESC"
|
||||||
data="defaulters"
|
data="defaulters"
|
||||||
|
on-data-change="$ctrl.reCheck()"
|
||||||
auto-load="true">
|
auto-load="true">
|
||||||
</vn-crud-model>
|
</vn-crud-model>
|
||||||
<vn-portal slot="topbar">
|
<vn-portal slot="topbar">
|
||||||
|
@ -90,6 +91,7 @@
|
||||||
<td shrink>
|
<td shrink>
|
||||||
<vn-check
|
<vn-check
|
||||||
ng-model="defaulter.checked"
|
ng-model="defaulter.checked"
|
||||||
|
on-change="$ctrl.saveChecked(defaulter.clientFk)"
|
||||||
vn-click-stop>
|
vn-click-stop>
|
||||||
</vn-check>
|
</vn-check>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -6,6 +6,7 @@ export default class Controller extends Section {
|
||||||
constructor($element, $) {
|
constructor($element, $) {
|
||||||
super($element, $);
|
super($element, $);
|
||||||
this.defaulter = {};
|
this.defaulter = {};
|
||||||
|
this.checkedDefaulers = [];
|
||||||
|
|
||||||
this.smartTableOptions = {
|
this.smartTableOptions = {
|
||||||
activeButtons: {
|
activeButtons: {
|
||||||
|
@ -68,6 +69,19 @@ export default class Controller extends Section {
|
||||||
return checkedLines;
|
return checkedLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
saveChecked(clientId) {
|
||||||
|
this.checkedDefaulers = this.checkedDefaulers.includes(clientId) ?
|
||||||
|
this.checkedDefaulers.filter(id => id !== clientId) : [...this.checkedDefaulers, clientId];
|
||||||
|
}
|
||||||
|
|
||||||
|
reCheck() {
|
||||||
|
if (!this.$.model.data || !this.checkedDefaulers.length) return;
|
||||||
|
|
||||||
|
this.$.model.data.forEach(defaulter => {
|
||||||
|
defaulter.checked = this.checkedDefaulers.includes(defaulter.clientFk);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getBalanceDueTotal() {
|
getBalanceDueTotal() {
|
||||||
this.$http.get('Defaulters/filter')
|
this.$http.get('Defaulters/filter')
|
||||||
.then(res => {
|
.then(res => {
|
||||||
|
|
Loading…
Reference in New Issue