No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Alternative to .15 dialog for form prop of old .14 dialog

    Framework
    1
    1
    487
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      dgk last edited by dgk

      This is what I had in .14
      I see the form prop is gone from the dialog component how do I accomplish the same now?
      I assume some alternative was created for before just dropping this???
      Would that be a modal? I liked option of having a simple form not part template but in the code.

          add () {
            this.$q.dialog.create({
              title: 'Add a new device',
              position: 'top',
              form: {
                name: {
                  type: 'text',
                  label: 'Enter a unique device name',
                  model: ''
                },
                desc: {
                  type: 'text',
                  label: 'Enter a Description',
                  model: ''
                },
                header1: {
                  type: 'heading',
                  label: 'Choose the hardware'
                },
                hardware: {
                  type: 'radio',
                  items: this.hardwareOpts,
                  model: ''
                }
              },
              buttons: [
                {
                  label: 'create',
                  color: 'positive',
                  handler: (data) => {
                    console.log('dialog data', data)
                    hardware.create({'name': data.name, 'desc': data.desc, 'hardware': data.hardware})
                      .then(response => {
                        console.log('created document id= ', response._id)
                        this.$data.items.push(response)
                        this.$q.toast.create.positive('new device created')
                        return response._id
                      })
                      .catch((err) => {
                        console.log('find error', err)
                      })
                  }
                },
                {
                  label: 'Cancel',
                  color: 'negative',
                  handler () {
                    return false
                  }
                }
              ]
            })
          },
      
      1 Reply Last reply Reply Quote 1
      • First post
        Last post