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

    how can i using Dialog in a JS method?

    Help
    3
    3
    215
    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.
    • M
      mfrz6 last edited by

      hi friends
      im want to using quasar dialog in a js mehod, but when call this method , return in OnOK or OnCancel not working

        ConfirmDialog() {
          Dialog.create({
            title: 'Confirm',
            message: 'Would you like to turn on the wifi?',
            ok: {
              push: true
            },
            cancel: {
              push: true,
              color: 'negative'
            },
            persistent: true
          }).onOk(() => {
            return 'Ok';
          }).onCancel(() => {
            return 'Cancel';
          }).onDismiss(() => {
            return 'Dismiss';
          })
         
          return 'dssd';
        }
      

      how can i do it? please help me

      metalsadman 1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by s.molinari

        You can’t return, because QDialog is an object with functions and not a function itself.

        Is this kind of what you are looking for?

        https://codepen.io/smolinari/pen/vYKKYRY?editors=1010

        Scott

        1 Reply Last reply Reply Quote 0
        • metalsadman
          metalsadman @mfrz6 last edited by

          @mfrz6 use Promises https://codepen.io/metalsadman/pen/LYZZyGy?editors=1010

          1 Reply Last reply Reply Quote 0
          • First post
            Last post