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

    q-table's expan drow collapse or uncollapse simultaneously(Solved)

    Help
    3
    5
    1106
    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
      guying last edited by guying

      here is my html

      <q-table
              color="primary"
              flat
              bordered
              separator="cell"
              :data="data"
              :columns="columns"
              :pagination.sync="pagination"
            >
      
              <template v-slot:body="props">
                <q-tr :props="props">
                  <q-td key="result" :props="props">{{ props.row.result }}</q-td>
                  <q-td key="test_name" :props="props">{{ props.row.test_name }}</q-td>
                  <q-td key="failed_info" class="col-overflow">
                    <q-btn
                      dense
                      round
                      flat
                      :icon="props.expand ? 'arrow_drop_up' : 'arrow_drop_down'"
                      @click="props.expand = !props.expand"
                    />
                    {{props.row.failed_info}}
                    </a>
                  </q-td>
                  <q-td key="time_cost" :props="props">{{ props.row.time_cost }}</q-td>
                  <q-td key="timeout" :props="props">{{ props.row.timeout }}</q-td>
                  <q-td key="owner" :props="props">{{ props.row.owner }}</q-td>
                  <q-td key="description" :props="props">{{ props.row.description }}</q-td>
                </q-tr>
                <q-tr v-show="props.expand" :props="props">
                  <q-td            
                    colspan="100%"
                    style="white-space:pre-wrap; word-wrap:break-word"
                  >
                    <div class="text-left">{{ props.row.failed_info }}</div>
                  </q-td>
                </q-tr>
              </template>
      
            </q-table>
      

      0e7b9e83-37fb-4067-8267-125b63477df0-image.png

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

        If I click button for “aaaa”, then button of “bar” collapses or uncollapses at the same time.

        No idea what happened

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

          @guying you didnt set your qtable’s row-key prop. https://quasar.dev/vue-components/table#Expanding-rows

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

            @metalsadman great thanks, it worked!!

            1 Reply Last reply Reply Quote 0
            • A
              alej09424 last edited by

              @guying
              The same thing happens to me and the row-key property is set some other suggestion

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