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

    QPopupEdit how to pass own argument?

    Framework
    4
    6
    909
    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.
    • K
      kiril4913 last edited by

      I use the popup component and there is @save event in my case it’s @save=“saveCellEditPopup”. By default there are two arguments (val, initialValue) that I can get in my saveCellEditPopup function but I need to add one more argument with id of the model’s element… how can I do this?

      I tried several variants:

      1. @save=“saveCellEditPopup(val, initialValue, props.row.id)”
        I get val == id and others are undefined;

      2. @save=“saveCellEditPopup(props.row.id)”
        I get id==id but val and initialValue are undefined;

      Is there any way to solve this?
      It will be very strange if it’s not…

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

        The component’s emit of the save event only sends the two arguments. So, trying to get a third out of it simply won’t work.

        However, with refs, you can get what you want in a backwards ass way I guess. It isn’t the cleanest thing to do, but it should work. I think. Hehehe…

        https://jsfiddle.net/9otz8frh/2/

        Maybe someone with more experience can find a better way?

        Scott

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

          Thinking about it more, I am less certain it will work. But, maybe it will. Try your luck. 😄

          Scott

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

            Thinking some more…

            It should work… 😄

            Obviously, you’ll have to come up with some sort of ref that includes the value, but is still unique for each field, to get the right id. The “key” (haha pun not intended), is adding the value, but the ref being still unique. So, I think that should get you on your way.

            Scott

            1 Reply Last reply Reply Quote 0
            • S
              sontis last edited by

              Hi.
              You can see solution in https://github.com/quasarframework/quasar/issues/2747
              I think in your case it will be
              @save="(val, initialValue) => saveCellEditPopup(val, initialValue, props.row.id)"

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

                yep, that’s what i’ve been struggling to find too avoiding two way binding to get proper handle on the value. i’m always reluctant to use refs or any dom way coz it seems hacky, but gotta do most of the time specially on edge cases shrugs.

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