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

    Checkbox inside a Dialog - how do I handle onchange?

    Help
    2
    5
    758
    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.
    • G
      gilad last edited by

      Hi,
      I got a Dialog object inside my vue and it has a form with a checkbox element in it (Quasar Dialog with a form of course).
      The checkbox uses an array as items.

      I want to handle the onchange of each checkbox item so that when it is checked/unchecked I can run some logic and check/uncheck other options.

      I.e. if my items are:
      blue
      red
      blue+red

      When the user checks the blue option and then checks the blue+red option I want to uncheck the blue and the red (to prevent duplicates).

      I tried the handler(data) but it seems not to run inside a checkbox element inside dialog form.

      Anyone tried something like this? Any tips/advice??

      Thanks!

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

        if you only want a single selection, make sure the model is not an array.

        1 Reply Last reply Reply Quote 0
        • G
          gilad last edited by

          Thanks but it’s a bit more complex then that (there’s a business logic I need to apply).
          Is there a way to catch the onchange of the checkboxes inside a dialog somehow?

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

            If it’s more complex then use the vue html component, not Dialog.create()

            1 Reply Last reply Reply Quote 0
            • G
              gilad last edited by

              Will do. I was hoping to avoid it and find a shortcut 🙂
              Thanks!

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