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

    Reusable QPopupEdit?

    Framework
    3
    6
    491
    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.
    • S
      SuspiOwl last edited by

      I have a table with 16 columns and 100 rows, each of the cell are editable using QPopupEdit, however the table become slower to load if I added QPopUpEdit on each q-td (like the example from the doc). I tried to remove the <q-popup-edit> on the for looped <q-td> and it loads way faster so the QPopupEdit is most likely the issue.

      I also added q-menu on each cell so I can right click on each cell to show different menu, was having the same issue and it causes the table become slower to load, so I implemented reusable menu like the example from doc by giving each cell its unique ID and use target on the q-menu, and the table loaded significantly faster

      I wonder if I can do the same thing in QPopupEdit like I did in QMenu.

      1 Reply Last reply Reply Quote 0
      • M
        Mila76 last edited by Mila76

        I’m working on this too…
        For now i used target like in qmenu:
        Outside qtable:

        <q-popup-edit v-model="valEdit" :target="targetEdit">
          <q-input type="number" v-model="valEdit" dense autofocus></q-input>
        </q-popup-edit>
        

        Inside:

        <q-td
          :props="props"
          @click="e => (targetEdit = e.target)"
        >{{ props.row.name }}</q-td>
        

        But you need to click 2 times 😞
        One to set the target and one to show the popup 😕
        I need to fix this, maybe with some method

        And obviusly a way to set wich row or cell i’m working on for @save 🙂

        1 Reply Last reply Reply Quote 0
        • M
          Mila76 last edited by Mila76

          First Step fix the double click problem:

          <q-popup-edit ref="popupEdit" v-model="valEdit" :target="targetEdit">
            <q-input type="number" v-model="valEdit" dense autofocus></q-input>
          </q-popup-edit>
          
          <q-td
            :props="props"
            @click="(e) => showEdit(e, props.row)"
          >{{ props.row.name}}</q-td>
          

          Initial data:

          valEdit: '',
          targetEdit: true
          

          Methods:

          showEdit(event, row) {
            this.targetEdit = event.target;
            this.$refs.popupEdit.show(event);
          }
          

          Another bug… click on edit… save or hide popup… click in the same cell… nothing happen… only another cell.
          But now my table end editing is fast.

          N 1 Reply Last reply Reply Quote 1
          • N
            nededa @Mila76 last edited by

            @Mila76 have you tried using it inside td and adding v-if on input? Then use popup events show/hide to render it? Not sure why a lot of such components doesn’t come with active status inside slot prop then we wouldn’t need to add another var for every item and use like

            <template v-slot:default="{active}">
             <q-input v-if="active" />
            </template>
            

            Then again it would be easy to make custom component for it.

            1 Reply Last reply Reply Quote 0
            • M
              Mila76 last edited by Mila76

              All my “bug” is fixed… Only one remain…
              InitialValue reset…

              Change 2 cell and if i put in both the same value the second dont trigger change or save at all. (same ad i dont change value at all)

              You see here the problems: https://jsfiddle.net/xemyc427/11/

              Any help?

              1 Reply Last reply Reply Quote 0
              • M
                Mila76 last edited by Mila76

                Here https://jsfiddle.net/xemyc427/20/ i fixed all my issues.
                The example is not very good but is easy enough to understand how can be done

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