Filter And Check Box Issue Fixed

This commit is contained in:
Devansh 2022-04-04 18:06:55 +05:30
parent 351d003a2b
commit bf578d3e94
5 changed files with 23 additions and 20 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=340de8a9442950e03627",
"/js/ui.js": "/js/ui.js?id=e718ab3251d631c4d098",
"/css/ui.css": "/css/ui.css?id=c8a7ade09358a1d61a4a"
}

View File

@ -72,6 +72,18 @@ Vue.filter('truncate', function(value, limit, trail) {
return value.length > limit ? value.substring(0, limit) + trail : value;
});
Vue.prototype.getCsrf = () => {
let token = document.head.querySelector('meta[name="csrf-token"]');
if (!token) {
console.error(
'CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'
);
}
return token.content;
};
/* require section */
require('flatpickr/dist/flatpickr.css');
require('vue-swatches/dist/vue-swatches.min.css');

View File

@ -95,6 +95,7 @@
:columns="columns"
:enable-actions="enableActions"
:enable-mass-actions="enableMassActions"
:index="index"
:mass-actions="massActions"
:mass-action-targets="massActionTargets"
:records="records"
@ -155,24 +156,10 @@ export default {
},
mounted: function() {
this.getCsrf();
this.makeURL();
},
methods: {
getCsrf() {
let token = document.head.querySelector('meta[name="csrf-token"]');
if (token) {
this.csrf = token.content;
} else {
console.error(
'CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'
);
}
},
makeURL() {
let newParams = '';
@ -374,7 +361,6 @@ export default {
}
this.isDataLoaded = true;
this.filterIndex = this.index;
this.perPage = this.itemsPerPage;
},

View File

@ -28,7 +28,11 @@
`return confirm('${massActionConfirmText}')`
"
>
<input type="hidden" name="_token" :value="csrf" />
<input
type="hidden"
name="_token"
:value="getCsrf()"
/>
<input
type="hidden"
@ -191,7 +195,7 @@
"
:data-method="action.method"
:data-action="record[`${action.key}_url`]"
:data-token="csrf"
:data-token="getCsrf()"
:target="
typeof action.target !== 'undefined' &&
action.target
@ -233,6 +237,7 @@ export default {
'columns',
'enableActions',
'enableMassActions',
'index',
'massActions',
'massActionTargets',
'records',
@ -280,7 +285,7 @@ export default {
if (i == 0) {
this.dataIds.push(
this.gridCurrentData.data[currentData][
this.filterIndex
this.index
]
);
}