Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select 2 change to default after close the modal #12

Open
rizaldi655 opened this issue Dec 28, 2023 · 0 comments
Open

select 2 change to default after close the modal #12

rizaldi655 opened this issue Dec 28, 2023 · 0 comments

Comments

@rizaldi655
Copy link

Screenshot 2023-12-28 165455

my code

the modal

{{--

{{ $item }}

--}}

Edit Item

                      <select data-clear wire:model="jenis"  class="form-select"  style="fon" data-pharaonic="select2" data-component-id="{{ $this->id }}"  >
                      <option ></option>
                      @foreach (\App\Models\Jenis::all() as $state)
                      <option value="{{ $state->id }}">{{ $state->jenis }}</option>
                      @endforeach
                      
                      </select>
                      {{-- <label class="form-label" for="example-text-input-floating" >Jenis</label> --}}
                      @error('jenis') <span class="error text-danger">{{ $message }}</span> @enderror 
                  </div>
              </div>
              <div class=" col-sm-5">
                  <div class="form-floating ">
                  <input type="text" class="form-control" id="example-text-input-floating" wire:model="nama_barang" value="{{$nama_barang}}" type="text" name="name" required   placeholder="John Doe">
                  <label class="form-label" for="example-text-input-floating" >Nama Barang</label>
                  @error('nama_barang') <span class="error text-danger">{{ $message }}</span> @enderror 
                  </div>
              </div>
              </div>
              <div class="row">
              <div class="col-sm-4">
                  <div class="form-floating ">
                  <input type="number" min="500" class="form-control" id="example-text-input-floating" wire:model="harga_beli"  type="text" name="name" required   placeholder="John Doe">
                  <label class="form-label" for="example-text-input-floating" >Harga Beli</label>
                  @error('harga_beli') <span class="error text-danger">{{ $message }}</span> @enderror 
                  </div>
              </div>
              <div class="col-sm-4">
                  <div class="form-floating ">
                  <input type="number" min="500" class="form-control" id="example-text-input-floating" wire:model="harga_jual"  type="text" name="name" required   placeholder="John Doe">
                  <label class="form-label" for="example-text-input-floating" >Harga Jual</label>
                  @error('harga_jual') <span class="error text-danger">{{ $message }}</span> @enderror 
                  </div>
              </div>
              <div class="col-sm-3">
                  <div class="form-floating ">
                  <input type="number" min="1" class="form-control" id="example-text-input-floating" wire:model="stok"  type="text" name="name" required   placeholder="John Doe">
                  <label class="form-label" for="example-text-input-floating" >Stok</label>
                  @error('stok') <span class="error text-danger">{{ $message }}</span> @enderror 
                  </div>
              </div>
              </div>
          </div>
          <div class="block-content block-content-full block-content-sm text-end border-top">
              
              <button   class="btn btn-success" style="background-color:#51820a;" >
                  {{ __('Save Changes') }}
              </button>
          </form>
      </div>
   </div>

{{--

--}}
@assets

<style> .select2-selection { height: 32px; } </style> {{-- <script src="{{asset('js/plugins/select2/js/select2.full.min.js')}}"></script> --}} <script src="{{ asset('vendor/pharaonic/pharaonic.select2.min.js') }}"></script> @endassets

i use livewire 3 and the modal use wire element ,
can some one help me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant