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

    QDataTable sticky column style enhancement

    Framework
    6
    6
    2316
    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.
    • T
      talski last edited by

      the current table style when there’s a sticky column can be confusing, you don’t know where a column end and another starts, I made some changes and get something like I needed, if anyone ever complained about it 🙂

      .q-data-table-sticky-right, .q-data-table-sticky-left
        tr:nth-child(odd)
          td:not(.invisible)
            background: #e6e6e6;
      
        tr:nth-child(even)
          td:not(.invisible)
            background: #f6f6f6;
      
        th:not(.invisible)
          background: #f9f9f9;
      

      Before:
      0_1505952316566_before.png

      After:
      0_1505952338975_after.png

      1 Reply Last reply Reply Quote 1
      • D
        danielo515 last edited by

        But how do you make the columns sticky ?

        N 1 Reply Last reply Reply Quote 0
        • N
          natxocc @danielo515 last edited by

          @danielo515 said in QDataTable sticky column style enhancement:

          But how do you make the columns sticky ?

          Sticky columns are available for 0.14.x not for 0.15.x for now.

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

            Is there a way to get the titles to stick?

            1 Reply Last reply Reply Quote 0
            • P
              peric0valdez last edited by peric0valdez

              I’m trying to make the headers sticky using this…but i’m still working on it
              Adding this to app.styl

              #maintable
                .q-table-middle.scroll
                  overflow-y scroll
                  height auto
                  max-height 356px
                  margin-top 36px
                .q-table-middle.scroll thead
                  position absolute
                  width 100%
                  background-color #f9f9f9
                  z-index 1
                  margin-top -36px
              

              In the layout of all my q-pages, i had to add this when any kind of changes is detected on my tables

              let thead = document.querySelector('#maintable thead tr')
              let tbody = document.querySelector('#maintable tbody tr')
              if (thead !== null && tbody !== null) {
                thead = thead.querySelectorAll('th')
                tbody = tbody.querySelectorAll('td')
                for (let i = 0; i < tbody.length; i++) {
                thead[i].style.width = tbody[i].offsetWidth + 'px'
              }
              

              But i get an ugly effect of my titles moving to his new sizes
              still working on it x2…

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

                Hi !

                I already did something to on my own that you can find here. Hope it will help 🙂

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