Add display articles & categories, raw mode
This commit is contained in:
@@ -8,11 +8,11 @@
|
||||
</div>
|
||||
<div class="col-4">
|
||||
{{ Form::label('model', 'Familles de produit') }}<br>
|
||||
@include('components.select', ['name' => 'model', 'id_name' => 'model', 'list' => $models_options, 'value' => isset($model) ? $model : null, 'class' => 'select2 form-control'])
|
||||
@include('components.select', ['name' => 'product_type', 'id_name' => 'product_type', 'list' => $models_options, 'value' => isset($product_type) ? $product_type : null, 'class' => 'select2 form-control'])
|
||||
</div>
|
||||
<div class="col-6">
|
||||
{{ Form::label('model_id', 'Produit') }}<br>
|
||||
@include('components.select2', ['name' => 'model_id', 'id_name' => 'model_id', 'value' => isset($model_id) ? $model_id : null, 'class' => 'select2 form-control'])
|
||||
@include('components.select2', ['name' => 'product_id', 'id_name' => 'product_id', 'value' => isset($product_id) ? $product_id : null, 'class' => 'select2 form-control'])
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -57,13 +57,13 @@
|
||||
@push('js')
|
||||
<script>
|
||||
|
||||
$("#model_id").change( function(e) {
|
||||
var model = $('#model_id').select2('data');
|
||||
var name = model[0]['text'];
|
||||
$("#product_id").change( function(e) {
|
||||
var product = $('#product_id').select2('data');
|
||||
var name = product[0]['text'];
|
||||
$('input[name="name"]').val(name);
|
||||
});
|
||||
|
||||
$('#model').change( function() {
|
||||
$('#product_type').change( function() {
|
||||
loadVarieties();
|
||||
});
|
||||
|
||||
@@ -71,10 +71,10 @@
|
||||
$.ajax({
|
||||
url : '{{ route('Botanic.Admin.Varieties.getSelect') }}',
|
||||
method : 'POST',
|
||||
data: {model: $('#model').val()},
|
||||
data: {model: $('#product_type').val()},
|
||||
success : function(data) {
|
||||
$("#model_id").select2({data: data});
|
||||
$("#model_id").val({{ $model_id }}).trigger('change');
|
||||
$("#product_id").select2({data: data});
|
||||
$("#product_id").trigger('change');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user