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

    DataTable hide-columns

    Framework
    2
    2
    1432
    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.
    • P
      polger last edited by

      Sometimes we want to hide just one or two columns (e.g. the id column).
      Would it make sense to also have a hide-columns vue property?

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

        You have the visible-columns property which is basically the same but with inverted logic.
        If you want to just hide one or two, use a filter. Imagine that documents is an array containing the documents that you want to show, and that you want to hide the __index property:

            data () {
                const documents = this.documents
                return {
                    page: 1,
                    filter: '',
                    columns: Object.keys(documents[0]).map(makeCol()),
                    visibleColumns: Object.keys(documents[0]).filter(i => i !== '__index')
                }
            }
        
        1 Reply Last reply Reply Quote 1
        • First post
          Last post