GWM:MultiDropdownSearchBox
This commit is contained in:
parent
6eff5a0157
commit
318b527f08
@ -26,7 +26,7 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="inputEmail4" class="col-form-label">Client Name<span class="text-danger">*</span></label>
|
||||
<select class="form-control cleint-select SelExample" name="client_id" id="SelExample" <?= isset($sales['client_id']) ? '' : 'required' ?>>
|
||||
<select class="form-control cleint-select SelExample" name="client_id" <?= isset($sales['client_id']) ? '' : 'required' ?>>
|
||||
<?= isset($sales['client_id']) ? '' : '<option value="">Select a Client</option>' ?>
|
||||
<?php foreach ($client as $value) : ?>
|
||||
<?php if ((int)$value["isactive"] === 1) : ?>
|
||||
@ -39,7 +39,7 @@
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="inputPassword4" class="col-form-label">Status<span class="text-danger">*</span></label>
|
||||
<select class="form-control status-select" name="status" required data-toggle="select2">
|
||||
<select class="form-control status-select" name="status" required data-toggle="select2" >
|
||||
<!-- <option value="">Select a Status</option> -->
|
||||
<option value="Created" <?= isset($sales['status']) && $sales['status'] === 'Created' ? 'selected' : '' ?>>Created</option>
|
||||
<option value="Paid" <?= isset($sales['status']) && $sales['status'] === 'Paid' ? 'selected' : '' ?>>Paid</option>
|
||||
@ -106,7 +106,7 @@
|
||||
if ($salechild['isactive'] == 1) : ?>
|
||||
<tr>
|
||||
<td>
|
||||
<select class="form-control book-select " name="item_details[]" required data-toggle="select2" id="" style="width: 249px !important;">
|
||||
<select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" id="" style="width: 249px !important;">
|
||||
<option value="">Select a Product</option>
|
||||
<?php foreach ($product as $value) : ?>
|
||||
<?php if ((int)$value["isactive"] === 1) : ?>
|
||||
@ -350,7 +350,7 @@ $(document).ready(function() {
|
||||
// Event listener for "Add More Item" button
|
||||
$('#addItem').click(function() {
|
||||
var newRow = '<tr>' +
|
||||
'<td><select class="form-control book-select" name="item_details[]" required data-toggle="select2" style="width: 249px !important;"><option value="">Select a Product</option><?php foreach ($product as $value) : if ((int)$value["isactive"] === 1) : ?><option value="<?= $value["product_id"] ?>"><?= $value["product_name"]; ?></option><?php endif; endforeach; ?></select></td>' +
|
||||
'<td><select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" style="width: 249px !important;"><option value="">Select a Product</option><?php foreach ($product as $value) : if ((int)$value["isactive"] === 1) : ?><option value="<?= $value["product_id"] ?>"><?= $value["product_name"]; ?></option><?php endif; endforeach; ?></select></td>' +
|
||||
'<td style="width:10%;"><input type="number" class="form-control item-quantity"min="0" name="quantity[]"/></td>' +
|
||||
'<td style="width:10%;"><input type="text" class="form-control item-rate" name="unit-price[]"readonly /></td>' +
|
||||
'<td style="width:8%;"><input type="text" class="form-control item-tax"name="item-tax[]" readonly /></td>' +
|
||||
@ -363,6 +363,7 @@ $(document).ready(function() {
|
||||
'</tr>';
|
||||
|
||||
$('#itemTable tbody').append(newRow);
|
||||
initializeSelect2();
|
||||
});
|
||||
|
||||
// Event listener for removing item
|
||||
@ -445,12 +446,17 @@ $(document).ready(function() {
|
||||
$(document).ready(function(){
|
||||
// Initialize select2
|
||||
$(".SelExample").select2();
|
||||
$(".SelExample").select2("val", "4");
|
||||
});
|
||||
function initializeSelect2() {
|
||||
$('.SelExample').select2({
|
||||
width: '249px' // Adjust width as needed
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
.select2-container--default .select2-results__option--highlighted[aria-selected]{
|
||||
color:#ffffff;
|
||||
background: #526dee!important;
|
||||
}
|
||||
.select2-container .select2-selection--single{
|
||||
height: 36px;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user