Last Page Issue Fixed

This commit is contained in:
Devansh Bawari 2022-08-02 11:26:56 +05:30
parent fa8f3e6d4e
commit 8af7989cac
3 changed files with 23 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/ui.js": "/js/ui.js?id=e341b90409ba0b1cc315",
"/js/ui.js": "/js/ui.js?id=cb527fcbce0488f30069",
"/css/ui.css": "/css/ui.css?id=d37fc925848045c24ee5"
}

View File

@ -102,12 +102,12 @@ export default {
DatagridPagination,
DatagridTable,
DatagridExtraFilters,
DatagridFilterTags
DatagridFilterTags,
},
mixins: [PersistDatagridAttributes],
data: function() {
data: function () {
return {
dataGridIndex: 0,
currentSort: null,
@ -115,11 +115,11 @@ export default {
id: btoa(this.src),
isDataLoaded: false,
massActionTargets: [],
url: this.src
url: this.src,
};
},
mounted: function() {
mounted: function () {
this.makeURL();
},
@ -162,10 +162,21 @@ export default {
axios
.get(this.url)
.then(function(response) {
.then(function (response) {
if (response.status === 200) {
let results = response.data;
if (
!results.records.data.length &&
results.records.prev_page_url
) {
self.url = results.records.prev_page_url;
self.refresh();
return;
}
self.initResponseProps(results);
self.initDatagrid();
@ -173,7 +184,7 @@ export default {
self.dataGridIndex += 1;
}
})
.catch(function(error) {
.catch(function (error) {
console.log(error);
});
},
@ -196,7 +207,7 @@ export default {
id: parseInt(id),
type: this.massActions[id].type,
action: this.massActions[id].action,
confirm_text: this.massActions[id].confirm_text
confirm_text: this.massActions[id].confirm_text,
});
}
},
@ -417,7 +428,7 @@ export default {
this.filters.push({
column: 'perPage',
cond: 'eq',
val: currentPerPageSelection
val: currentPerPageSelection,
});
this.makeURL();
@ -452,7 +463,7 @@ export default {
this.url = pageLink;
this.refresh();
}
}
}
},
},
};
</script>