I add a filter range from backpack.
But the input for the min and max is too small, I want to set the width. How do I set it? This is my Code.
$this->crud->addFilter([ // daterange filter
'type' => 'date_range',
'name' => 'from_to',
'label' => 'Date',
], false, function ($value) { // if the filter is active, apply these constraints
$dates = json_decode($value);
$this->crud->addClause('where', 'created_at', '>=', $dates->from);
$this->crud->addClause('where', 'created_at', '<=', $dates->to.' 23:59:59');
});
There is no way to change the width of the inputs there. But you can easily create a new filter, starting from this one, which is wider, and use that one. You just need to:
php artisan backpack:publish crud/filters/range
. This will copy-paste the file in your resources/views/vendor/backpack/crud/filters/range.blade.php
.wide_range.blade.php
. Then change the css/html inside it to fit your needs.wide_range
filter instead of range
.Then you'll have a range filter as wide as you want.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.