parent category disabled control

This commit is contained in:
Burak Civan 2022-12-13 10:37:05 +03:00
parent a9c98c35ab
commit 0c59b219e1
2 changed files with 4 additions and 1 deletions

View File

@ -30,6 +30,7 @@ const app = new Vue({
form: new Form('category'), form: new Form('category'),
bulk_action: new BulkAction('categories'), bulk_action: new BulkAction('categories'),
categoriesBasedTypes: null, categoriesBasedTypes: null,
selected_type: true
} }
}, },
@ -51,6 +52,8 @@ const app = new Vue({
return; return;
} }
this.selected_type = false;
this.categoriesBasedTypes = JSON.parse(this.form.categories)[event]; this.categoriesBasedTypes = JSON.parse(this.form.categories)[event];
} }
} }

View File

@ -24,7 +24,7 @@
<x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" :selected="config('general.types')" change="updateParentCategories" /> <x-form.group.select name="type" label="{{ trans_choice('general.types', 1) }}" :options="$types" :selected="config('general.types')" change="updateParentCategories" />
<x-form.group.select name="parent_id" label="{{ trans('general.parent') . ' ' . trans_choice('general.categories', 1) }}" :options="[]" not-required dynamicOptions="categoriesBasedTypes" sort-options="false" /> <x-form.group.select name="parent_id" label="{{ trans('general.parent') . ' ' . trans_choice('general.categories', 1) }}" :options="[]" not-required dynamicOptions="categoriesBasedTypes" sort-options="false" v-disabled="selected_type" />
<x-form.input.hidden name="categories" value="{{ json_encode($categories) }}" /> <x-form.input.hidden name="categories" value="{{ json_encode($categories) }}" />
</x-slot> </x-slot>