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

    table with (nested) object data

    Help
    3
    3
    2628
    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.
    • D
      dapo last edited by

      I’ve found that when defining the table columns, you cannot define 'field': 'item.subitem'

      while I found that it can be tricked by using

      format (value) {
        return value.subitem
      }
      

      it doesn’t work when it comes to sorting

      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by

        Quasar v0.11 (trying to release at the end of this week) will get enhanced sorting capabilities including specifying your own sorting method. This will allow you in your problem here.

        One more thing that you can do even with v0.10 is to compute/alter/map your data before you feed it to DataTable, so instead of using an object as cell value, use the object’s property directly in the computed data --> the result will be that you’ll feed DataTable directly with the value that you want to display. Example (let’s say you want for ‘col2’ to display ‘col2.secondprop’):

        Original Data:

        let orig = [
          {col1: 'some data', col2: {oneprop: 'sdfs', secondprop: '...'}},
          ....
        ]
        
        // Computed data:
        orig.map(row => {
          return {
            col1: row.col1,
            col2: row.col2.secondprop
          }
        }
        
        1 Reply Last reply Reply Quote 1
        • D
          damosse31 last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • First post
            Last post