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

    [solved] QInput + QTable + v-model - Update DB when field change is submited

    Help
    2
    5
    779
    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.
    • mojimo
      mojimo last edited by mojimo

      I’d like to send a changed value from edited column to a database only if QInput field in QTable is changed. But v-model is updated with every input change - doesn’t matter if I use property to show SET and CANCEL buttons for QInput.

      How should I send a changed value to database only if the field is changed (editted field is submited with enter or with SET if buttons are visible)?

       <q-popup-edit v-model="props.row.FIELD_TO_CHANGE">
            <q-field>
                    <q-input v-model="props.row.FIELD_TO_CHANGE" />
             </q-field>
       </q-popup-edit>
      

      I tried .lazy with v-model but it has no influence.

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

        Solution is simple. If I read the documentation not only for table but also for popup edit:

         <q-popup-edit @save="updateFiled" buttons v-model="props.row.FIELD_TO_CHANGE">
           <q-field>
                 <q-input v-model="props.row.FIELD_TO_CHANGE"/>
            </q-field>
        </q-popup-edit>
        
        1 Reply Last reply Reply Quote 0
        • mojimo
          mojimo last edited by

          Still not perfect. How can I pass an information about a row in datatable? @Save has only old and new value. But I need to update a row in a table.

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

            solution: @save="updateField(props.row)"

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

              nice, usually the doc is helpful enough, just require some more reading and checking the source of the samples in there or the framework helps as well.

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