I want to change the text font for my options in a select box. The problem is that I also want to display icons before some options. If I change the font-style, the font-awesome icons won't be displayed and I don't think it is possible to style the options themselves, only the whole select box.
Here is some of my code:
<div class="form-group">
{{ Form::label('qualifications', 'Qualifications') }}<br>
<select size="5" class="fa form-control" id="selectedqualification">
<!-- displays an fa-warning icon after every qualification that's expiring -->
#foreach ($employee_qualifications as $key => $qualification)
#if($expiringQualifications->contains($qualification))
<option value="{{$key}}">{{$qualification}} </option>
#else
<option value="{{$key}}">{{$qualification}}</option>
#endif
#endforeach
</select>
<button
type="button"
class="btn btn-default pull-right"
data-toggle="modal"
data-target="#qualificationModal"
data-qualifications="{{ $qualifications }}"
data-qualification_names="{{ $qualification_names }}">
Add
</button>
<button type="button" id="removequali" class="btn btn-danger pull-right">Remove</button>
<br>
<br>
</div>
Related
How can I input a link in the button when I press the button?
<div class="buttons">
<span class="sold-out-tag position-top-right">Best Seller</span>
<button class="btn custom-btn position-bottom-right"> Add to cart</button>
</div>
Also you can trigger a link by JavaScript.
<button
onclick="window.location(this.getAttribute('data-link'))"
data-link="/hello">go to hello</button>
One way could be to use an anchor tag instead of the button and make it look like a button.
HTML:
<div class="buttons">
<a class="btn custom-btn position-bottom-right"> Add to cart</a>
</div>
CSS:
.custom-btn {
border: medium dashed green;
}
Alternatively, you could do:
<button class="btn custom-btn position-bottom-right" onclick="location.href='yourlink.com';"> Add to Cart </button>
Try this:
<a href='http://my-link.com'>
<button class="GFG">
Click Here
</button>
</a>
You can use the anchor tag and provide a Bootstrap class for the button, like,
<a class="btn btn-success" href="link"> Add to Cart</a>
If the label "Add to cart" matches the expectations, we'd be talking about a form. A form that causes an element to be added typically uses the POST method:
<form class="buttons" method="post" action="/path/to/add/to/cart/script">
<input type="hidden" name="product" value="123">
<span class="sold-out-tag position-top-right">Best Seller</span>
<button class="btn custom-btn position-bottom-right"> Add to cart</button>
</form>
Alternatively, there's GET as well:
<form class="buttons" method="get" action="/path/to/add/to/cart/script?product=123">
<span class="sold-out-tag position-top-right">Best Seller</span>
<button class="btn custom-btn position-bottom-right"> Add to cart</button>
</form>
Since GET doesn't carry additional payload, you'll get the same effect with a regular anchor:
Add to cart
You don't want search engine spiders to populate carts, so you typically leave GET for data fetching.
I'm trying to make an Edit Modal using Angular. the td fields get a value from this table and send it to a modal using the (click) event
<tbody>
<tr *ngFor="let mascota of mascotas" class="text-center ">
<td>{{mascota.name}}</td>
<td>{{mascota.birthDate}}</td>
<td>{{mascota.species.name}}</td>
<td>
<button class="btn btn-info mx-2">Detalles</button>
<button class="btn btn-warning mx-2" (click)="openSM(contenido,mascota)">Editar</button>
<button class="btn btn-danger mx-2">Remover</button>
</td>
</tr>
</tbody>
This is the function that I made in the component, used a const in order to get the values and send it to the modal
openSM(contenido, mascota) {
const modalRef = this.modal.open(contenido,{size:'lg',centered:true});
modalRef["mascota"] = mascota;
console.log(modalRef);
}
And this is the modal where I'm tying to get the value
<ng-template #contenido let-modal>
<div class="modal-header">
<h4 class="modal-title">Editar datos de mascota</h4>
<button class="close" aria-label="close" type="button" (click)="modal.close()">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form class="form-horizontal form-material" id="editform" autocomplete="off">
<div class="form-group m-t-10">
<div class="col-sm-10">
<label>Nombre de Mascota:</label>
<input class="form-control" type="text" placeholder="Nombre" value="mascota.name" />
</div>
</div>
</form>
</div>
</ng-template>
But when I click on the Edit button it didn't recognize the value
And when I used {{}} the const get an 'undefined' value
Error from Inspect Element
Contenido Data
Is there any way to get that value and put it into the input tag? I want to do the same with the others td fields, but first this needs to work well
Console log of the inputs in the constructor
I am trying to show product items into shopping cart when i click add to card button how to fix it error? Call to undefined function Gloudemans\Shoppingcart\array_get()
https://flareapp.io/share/B5ZeYg7o#F46
Controller
public function cart()
{
return view('frontend/cart');
}
public function addCart(Request $request)
{
$product = Product::findOrFail($request->id);
$cartItem = Cart::add([
'id' => $product->id,
'product_name' => $product->name,
'product_brand'=>$product->product_brand,
'qty' => $request->qty,
'product_price' => $product->product_price,
]);
Cart::associate($cartItem->rowId, 'App\Product');
return redirect()->route('cart.index');
}
}
model product
class product extends Model
{
protected $fillable =[ 'id', 'product_name', 'product_price',
'product_image',
'product_brand'];
}
html view
<tbody class="cart-table__body">
#foreach (Cart::content() as $item)
<tr class="cart-table__row">
<td class="cart-table__column cart-table__column--image">
<a href=""><img src="{{ asset($item->model->image) }}" alt="product">
</a>
</td>
<td class="cart-table__column cart-table__column--product">
{{$item->model->product_name}}
</td>
<td class="cart-table__column cart-table__column--price" data-title="Price">
{{$item->model->product_price}}</td>
<td class="cart-table__column cart-table__column--quantity" data-
title="Quantity">
<div class="input-number">
<input class="form-control input-number__input" type="number" min="1" value="
{{$item->qty}}">
<div class="input-number__add"></div>
<div class="input-number__sub"></div>
</div>
</td>
<td class="cart-table__column cart-table__column--total" data-title="Total">
</td>
<td class="cart-table__column cart-table__column--remove">
<a href="" class="btn btn-light btn-sm btn-svg-icon">
<svg width="12px" height="12px">
<use xlink:href="{{url('public/assets/images/sprite.svg#cross-12')}}"></use>
</svg>
</a>
</td>
</tr>
#endforeach
</tbody>
form html view
<form action="{{route('cart.action')}}" method="post"
class="product__options">
{{ csrf_field() }}
<input type="hidden" name="id" value="{{$single_products->id}}">
<input type="hidden" name="product_name" value="
{{$single_products->product_name}}">
<input type="hidden" name="product_image" value="
{{$single_products-
>product_image}}">
<input type="hidden" name="product_brand" value="
{{$single_products->product_brand}}">
<input type="hidden" name="product_price" value="
{{$single_products->product_price}}">
<div class="form-group product__option">
<label class="product__option-label" for="product-
quantity">Quantity</label>
<div class="product__actions">
<div class="product__actions-item">
<div class="input-number product__quantity">
<input id="product-quantity" name="qty" class="input-
number__input form-control
form-control-lg" type="number" min="1" value="1">
<div class="input-number__add"></div>
<div class="input-number__sub"></div>
</div>
</div>
<div class="product__actions-item product__actions-item--
addtocart">
<button class="btn btn-primary btn-lg">Add to
cart</button>
</div>
<div class="product__actions-item product__actions-item--
wishlist">
<button type="button" class="btn btn-secondary btn-svg-
icon btn-lg" data-
toggle="tooltip" title="Wishlist">
<svg width="16px" height="16px">
<use xlink:href="
{{url('public/assets/images/sprite.svg#wishlist-
16')}}"></use>
</svg>
</button>
</div>
<div class="product__actions-item product__actions-item--
compare">
<button type="button" class="btn btn-secondary btn-svg-
icon btn-lg" data-
toggle="tooltip" title="Compare">
<svg width="16px" height="16px">
<use xlink:href="
{{url('public/assets/images/sprite.svg#compare-16')}}">
</use>
</svg>
</button>
</div>
</div>
</div>
</form>
Route::get('/cart','CartController#cart')->name('cart.index');
Route::post('cart/action','CartController#addcart')-
name('cart.action');
Laravel introduced breaking changes around 5.8/6.0 wherein they removed a lot of the helper functions in favor of using the facades.
The problem is that this function:
arr_get()
which is the cause of the error, is unfortunately no longer part of the standard Laravel build. If it was in your own class, you could change this out to use the facade:
use Illuminate\Support\Arr;
and then in your method:
Arr::get();
Instead of changing the vendor code, you could check to see if you have the latest version of the shopping cart package, which would be compatable with Laravel's later versions... or you can add the helper package from Laravel that will bring back those helpers into your base Laravel distro.
I am new in ag-grid, I am using ag-grid in the angular5+ app.
I have implemented a custom column level filter by implementing IHeaderAngularComp interface. it's working fine in desktop/laptop. but it's not working in touch devices like iPad/mobile etc.
it seems to the header is not detecting touch event.
In the custom header, I implemented an input text box. it's working fine in desktop but when I use touch device iPad/mobile, the input box gets disable.
ag-Grid version: X.X.X
"ag-grid": "15.0.0",
"ag-grid-angular": "15.0.0"
Angular version: 5.1.2
//custom-header.component.html
<div>
<a class="btn btn-sm text-truncate py-0" [ngStyle]="{'width':'98%'}" (click)="sortBy($event)">
<i class="fa" [ngClass]="{'fa-sort-desc': currentOrder=='desc', 'fa-sort-asc': currentOrder=='asc'}"
[hidden]="!currentOrder"></i>
<span>{{params.displayName}}</span>
</a>
<div class="input-group input-group-sm pl-2" [ngStyle]="{'width':'90%'}" *ngIf="params.bISActiveForFilter">
<input type="text" class="form-control form-control-sm align-self-center filterTxtBox py-0" name="search"
(keyup.enter)="onEnterPress($event)" [(ngModel)]="searchText">
<span class="input-group-btn filterTxtClsBtn" [hidden]="!searchText">
<button type="button" class="btn btn-outline-secondary btn-sm py-0" (click)="clearColFilter($event)"><i
class="fa fa-times"></i></button>
</span>
</div>
And from the parent component, I'm calling custom-header component as below
columnDef.headerComponentFramework = CustomHeaderComponent;
I am trying to achieve this where Select projects is a multi-select dropdown menu and Filter Results is a collapse button, which when clicked has another three multi-select dropdown menus. I am using chosen-select for implementing the multi-select dropdown menus.
My Select projects is working fine and my Filter results collapse button is also working. But within the collapse button, the three dropdowns are not working (as shown in the image). When I remove the chosen-select from my first dropdown, I can see selection box working fine but its not a dropdown anymore. I also tried renaming the class in select to some other name but its still not working.
Also, if seen closely, there are lines in the collapse section where the selection box should be present, if I click this, I can see the line extending but its width is zero.
Please help me, I tried multiple things, but no luck. Below is the code. Thanks in advance.
<div class="container">
<div class="col-md-5" style="margin: 30px;">
<h3 style="font-variant: small-caps;">Select Projects:</h3>
<form id="selectProject" role="search" method="get" action="{% url 'select_projects' %}">
<select name="params[]" data-placeholder="Choose projects" class="chosen-select" multiple tabindex="4">
{% for project in project_names %}
{% if project in display_selected %}
<option value="{{ project }}" selected="selected"> {{ project }}</option>
{% else %}
<option value="{{ project }}"> {{ project }} </option>
{% endif %}
{% endfor %}
</select><br/>
<label for="submit"></label><button id="submit" type="submit" class="btn btn-default" style="padding: 5px 40px;">Submit</button>
</form>
</div>
</div>
<div><br /></div>
<div class="container">
<div class="col-md-5" style="margin: 30px;">
<div class="row">
<button type="button" class="btn btn-info" data-toggle="collapse" data-target="#filterParam">
Filter Results
</button>
</div>
<div class="collapse" id="filterParam">
<form id="selectFilters" role="search" method="get" action="{% url 'select_projects' %}">
<div class="form-group"><div><br /></div>
<select name="fruit[]" data-placeholder="Choose fruits" multiple tabindex="4" style="width: 200px;">
<option> apple </option>
<option> mango </option>
<option> grapes </option>
</select><div><br /></div>
<select name="color[]" data-placeholder="Choose colors" class="chzn-select" multiple tabindex="4" style="width: 200px;">
<option> red </option>
<option> orange </option>
<option> green </option>
</select><div><br /></div>
<select name="toppings[]" data-placeholder="Choose toppings" class="chosen-select" multiple tabindex="4" style="width: 200px;">
<option> cheese </option>
<option> olives </option>
<option> peppers </option>
</select><div><br /></div>
</div>
<label for="submitFilters"></label><button id="submitFilters" type="submit" class="btn btn-default" style="padding: 3px 15px;">Refresh</button>
</form>
</div>
</div>
</div>
<script src="{% static 'app/js/chosen.jquery.js' %}"></script>
<script>
$('.chosen-select').chosen();
$('.chzn-select').chosen();
</script>
Fixed the issue with this change: $('.chzn-select').chosen({width: '100%'});