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

    Change ok button of dialog depending on tab selected

    Help
    2
    7
    1057
    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.
    • djcaesar9114
      djcaesar9114 last edited by

      Hello,
      I’d like to change the button of a dialog when a tab in this dialog is selected.
      I already have <q-tab @select=“changeInstitution()” … but I have the impression that the “ok” button of the dialog can’t be linked to any model…
      How can I do that?
      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • C
        chbarr last edited by

        Bind your label prop button to a computed properties.

        In this computed properties return a value depending on your selected tab.

        1 Reply Last reply Reply Quote 0
        • djcaesar9114
          djcaesar9114 last edited by

          That is exactly what I want to do, but How can I do it? I tried to put
          ok=“myButton”
          But it only displays “myButton”. What is the correct syntax?

          1 Reply Last reply Reply Quote 0
          • C
            chbarr last edited by chbarr

            you can have a prop in your modal for your custom label.
            And change this prop value on <q-tabs> select event

            See an example: https://jsfiddle.net/cLqkmcor/3/

            1 Reply Last reply Reply Quote 0
            • djcaesar9114
              djcaesar9114 last edited by

              Thanks, I understand better quasar mechanics thanks to you.
              Dialog doesn’t allow a dynamic button for “OK”, but with “Modal” I can emulate a dialog with this functionality, right?

              1 Reply Last reply Reply Quote 0
              • C
                chbarr last edited by

                You can refer to the documentation concerning Dialog: This means Dialogs should only be used for quick actions, like password verification, small App notifications or quick options. More in depth user flows should be reserved for ​Modals​.

                So you are right. If your “floating” component is a little complex, it’s better to use Modal

                1 Reply Last reply Reply Quote 0
                • djcaesar9114
                  djcaesar9114 last edited by

                  Thanks a lot for your answer.
                  It was unclear why a component was a sub-component of another, now I understand the principle, although I don’t agree with it 🙂

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