Link to home
Start Free TrialLog in
Avatar of emi_sastra
emi_sastra

asked on

Put button at the same row with other control.

Hi All,

I have below display.
Please have a look at the image.
Is there possible to put the button at the same row with the data filter (drop down) ?

Thank you.
Arrange-Display.PNG
Avatar of emi_sastra
emi_sastra

ASKER

I use coreUI template.

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of Zakaria Acharki
Zakaria Acharki
Flag of Morocco image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Zakaria,

This my code, where to change?

{{ html()->modelForm($filters, 'POST')->acceptsFiles()->class('')->open() }}
@php
    //dump($filters)
    $bulans = [
        '01' => 'Januari',
        '02' => 'Februari',
        '03' => 'Maret',
        '04' => 'April',
        '05' => 'Mei',
        '06' => 'Juni',
        '07' => 'Juli',
        '08' => 'Agustus',
        '09' => 'September',
        '10' => 'Oktober',
        '11' => 'November',
        '12' => 'Desember',
    ];
    $tahuns = [];
    foreach(range(date('Y'), date('Y') - 5) as $thn){
        $tahuns[$thn] = $thn;
    }
@endphp
<a data-toggle="collapse" href="#filterForm" role="button" aria-expanded="true" aria-controls="filterForm">
    Filter: @if (count($filters) > 0)
    <span class="badge badge-pill badge-success">{{ count($filters) }}</span>
    @endif
</a>
<div class="collapse show collapse-form" id="filterForm">
    <div class=" card card-body">
        <div class="row">
            @if(isset($filters['bulan']))
                <div class="form-group col-sm-3 col-md-2">
                    {{ html()->label('Bulan')->class('form-control-label')->for('bulan') }}
                    {{ html()->select('bulan', $bulans)
                        ->class('form-control') }}
                </div>
            @endif
            <div class="form-group col-sm-3 col-md-2">
                {{ html()->label('Tahun')->class('form-control-label')->for('tahun') }}
                {{ html()->select('tahun', $tahuns)
                    ->class('form-control') }}
            </div>
        </div>
        <div class="row">
            <div class="col text-right">
                {{-- <input class="btn btn-xs btn-default" type="submit" name="clear" value="Hapus Filter"> --}}
                <button class="btn btn-xs btn-primary">Filter</button>
            </div>
        </div>
    </div>
</div>
{{ html()->closeModelForm() }}

Open in new window


Thank you.
I try this.

<div class="collapse show collapse-form" id="filterForm">
    <div class=" card card-body">
        <div class="row">
            @if(isset($filters['bulan']))
                <div class="form-group col-sm-3 col-md-2">
                    {{ html()->label('Bulan')->class('form-control-label')->for('bulan') }}
                    {{ html()->select('bulan', $bulans)
                        ->class('form-control') }}
                </div>
            @endif
            <div class="form-group col-sm-3 col-md-2">
                {{ html()->label('Tahun')->class('form-control-label')->for('tahun') }}
                {{ html()->select('tahun', $tahuns)
                    ->class('form-control') }}
            </div>

            <div class="col text-right">
                 <label class="col-form-label">&nbsp;</label>
                {{-- <input class="btn btn-xs btn-default" type="submit" name="clear" value="Hapus Filter"> --}}
                <button class="btn btn-xs btn-primary">Filter</button>
            </div>
        </div>
       
    </div>
</div>

Open in new window


The filter at the label row not at the drop down row. why ?

Thank you.
I add offset-md-7 and it works great.

<div class="offset-md-7"></div>

            <div class="col text-right">
                 <label class="col-form-label">&nbsp;</label>
                {{-- <input class="btn btn-xs btn-default" type="submit" name="clear" value="Hapus Filter"> --}}
                <button class="btn btn-xs btn-primary">Filter</button>
            </div>

Open in new window


Thank you.
Hi Zakaria,

Thank you very much for your help.
Hi Emi, You're welcome, Glad I could help.