Skip to content

Commit

Permalink
Merge pull request #5328 from takkkken/fixed_bitween_filter_ui
Browse files Browse the repository at this point in the history
Fixed to allow many inputmask type in between filter.
  • Loading branch information
jxlwqq authored May 26, 2021
2 parents 8a95362 + 1519fe6 commit e78ebbc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions resources/views/filter/between.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<label class="col-sm-2 control-label">{{$label}}</label>
<div class="col-sm-8" style="width: 390px">
<div class="input-group input-group-sm">
<input type="text" class="form-control" placeholder="{{$label}}" name="{{$name['start']}}" value="{{ request()->input("{$column}.start", \Illuminate\Support\Arr::get($value, 'start')) }}">
<input type="text" class="form-control {{$id['start']}}" placeholder="{{$label}}" name="{{$name['start']}}" value="{{ request()->input("{$column}.start", \Illuminate\Support\Arr::get($value, 'start')) }}">
<span class="input-group-addon" style="border-left: 0; border-right: 0;">-</span>
<input type="text" class="form-control" placeholder="{{$label}}" name="{{$name['end']}}" value="{{ request()->input("{$column}.end", \Illuminate\Support\Arr::get($value, 'end')) }}">
<input type="text" class="form-control {{$id['end']}}" placeholder="{{$label}}" name="{{$name['end']}}" value="{{ request()->input("{$column}.end", \Illuminate\Support\Arr::get($value, 'end')) }}">
</div>
</div>
</div>
6 changes: 5 additions & 1 deletion src/Grid/Filter/Presenter/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,11 @@ public function inputmask($options = [], $icon = 'pencil'): self
{
$options = json_encode($options);

Admin::script("$('#{$this->filter->getFilterBoxId()} input.{$this->filter->getId()}').inputmask($options);");
$ids = (array) $this->filter->getId();

foreach ($ids as $id) {
Admin::script("$('#{$this->filter->getFilterBoxId()} input.{$id}').inputmask($options);");
}

$this->icon = $icon;

Expand Down

0 comments on commit e78ebbc

Please sign in to comment.