Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QTable - animation for expanding/closing row #4380

Open
m0jimo opened this issue Jun 14, 2019 · 13 comments
Open

QTable - animation for expanding/closing row #4380

m0jimo opened this issue Jun 14, 2019 · 13 comments

Comments

@m0jimo
Copy link
Contributor

m0jimo commented Jun 14, 2019

Is your feature request related to a problem? Please describe.
I use q-table with expanding rows. I think that from UI perspective is better to have a row expanded with animation rather than quick show/hide.
It is easy to do it with div table but I haven't found a way for table/td/tr.

Describe the solution you'd like
Add property/class which will animate expanding row.

Describe alternatives you've considered
If it is not suitable to be part of q-table it'd be nice to have a link to a how-to where could be piece of code how to manage it.

Additional context
Expanding rows example from the documentation page.

@rfox12
Copy link
Contributor

rfox12 commented Sep 12, 2019

I second the notion! Also if we can add to this request.. an "expand all" option?

@trondulseth
Copy link

An upvote from me also :)

@luckylooke
Copy link

Suitable also for adding, removing rows dynamically 👍

@Batsirai
Copy link

And the ability to have a single row open at a time...

@m0jimo
Copy link
Contributor Author

m0jimo commented Dec 24, 2019

And the ability to have a single row open at a time...

Im using an example in docs for expanding a row for qtable. If it doesn't fit to your need You can open a new issue.

@apavel3458
Copy link

Definitely need to animate the expanding. Also useful to have a single row open at a time!

@ecmap
Copy link

ecmap commented Aug 21, 2020

I have tried to use QSlideTransition in Qtable, but it does not work

Does anyone know how to use it in Qtable?

@davidparraz41
Copy link

I have many tables with expansion rows, i need some animation to open or close the row, something like q-expansion-item but for q-table

@philfontaine
Copy link
Contributor

I use the following to animate the QTable height (can probably work for any component I would think).

SlideTransition.vue

<template>
  <div ref="container" style="transition: height 0.4s; overflow: hidden;">
    <div ref="content">
      <slot></slot>
    </div>
  </div>
</template>

<script>
import { defineComponent, onMounted, onUnmounted, ref } from 'vue'

export default defineComponent({
  setup() {
    const content = ref()
    const container = ref()
    const resizeObserver = new ResizeObserver(() => {
      container.value.style.height = content.value.scrollHeight + 'px'
    })

    onMounted(() => {
      resizeObserver.observe(content.value)
    })
    onUnmounted(() => {
      resizeObserver.disconnect()
    })

    return {
      container,
      content,
    }
  },
})
</script>

Example usage

<template>
  <SlideTransition>
    <q-table></q-table>
  </SlideTransition>
</template>

@hendrik-schneider
Copy link

I would prefer if the animation of the qTable-expansion-row was included in the default of Quasar and would work like the qExpansionItem.

@namespace-github
Copy link

Is there an update here? This is a frequently requested feature and would fit in well with the "Quasar style" if there was a smooth open and close animation. Maybe incomming with Quasar 3?

@brakop
Copy link

brakop commented Aug 26, 2022

Since I'm literally working on coding this atm, it would be great to upvote this as a standard part of q-table!

@brakop
Copy link

brakop commented Aug 26, 2022

Also, suggestion for anyone else working on this, don't try to transition the TR, just transition a div or divs within it:
<q-tr style="height:0px;padding:0px;"> <q-td :colspan="props.cols.length" style="height:0px;padding:0px;" > <transition name="fadeHeight"> <div v-if="FridgesSelected" > This is the magic row you want to display/hide </div> </transition> </q-td> </q-tr> </q-table>

<style> .fadeHeight-enter-active, .fadeHeight-leave-active { transition: all 0.5s; max-height: 230px; } .fadeHeight-enter-from , .fadeHeight-leave-to { opacity: 0; max-height: 1px; } </style>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests