Quasar: How to show datePicker when trigger @click event?

Created on 17 Apr 2019  路  7Comments  路  Source: quasarframework/quasar

    <q-input
          ref="date"
          filled
          v-model="bookingForm.date"
          label="Appointment Date"
          lazy-rules
          :rules="[ val => val !== null && val !== '' || 'Please select a date']"
          @click="showDatepicker"
        >
          <template v-slot:append>
            <q-icon name="event" class="cursor-pointer">
              <q-popup-proxy ref="qDateProxy">
                <q-date
                  v-model="bookingForm.date"
                  :options="optionsValidDates"
                  @input="closeDatePickerDialog"
                />
              </q-popup-proxy>
            </q-icon>
          </template>
        </q-input>

Most helpful comment

<q-input @click="$refs.qDateProxy.show()"

All 7 comments

<q-input @click="$refs.qDateProxy.show()"

<q-input @click="$refs.qDateProxy.show()"

It works, thanks. BTW, how to make DatePicker uneditable, so user can only select date from picker, can't type date manually.

Use only the QIcon part, without the input.

Use only the QIcon part, without the input.

we still need space to show date selected, like https://amsul.ca/pickadate.js/date/

If you have specific use-cases, use QField to build your own https://v1.quasar-framework.org/vue-components/field

If you have specific use-cases, use QField to build your own https://v1.quasar-framework.org/vue-components/field

For QField, any @click or @touch event?

Could you point me to documentation about using the poup proxy?

It's very complicated.. I hope in future we could simply use an input of type date to have the calendar popup for free

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexeigs picture alexeigs  路  3Comments

green-mike picture green-mike  路  3Comments

jigarzon picture jigarzon  路  3Comments

Bangood picture Bangood  路  3Comments

adwidianjaya picture adwidianjaya  路  3Comments