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

    [Solved] Datatable a small problem with field and a nested field (v0.17.16)

    Framework
    2
    3
    750
    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.
    • Q
      QuaDgf last edited by Shone

      Hello, I would like to use a nested field in a column of a datatable

      I tried to define this way but it didn’t work.

      field: o => o.f

      I created a jsfiddle:

      https://jsfiddle.net/jauslms/kL71r68a/12/

      I have a workaround from here:
      https://github.com/quasarframework/quasar/issues/821

      slot=“body-cell-o”
      {{ props.value.f }}

      Anyone can help me?
      Thank you very much

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

        https://quasar-framework.org/components/datatable.html

            // row Object property to determine value for this column
            field: 'name',
            // OR field: row => row.some.nested.prop
        

        Looks like it should be:

        row => row.o.f
        

        I changed this line in your fiddle and now it works:

        { label: 'One more', field: row => row.o.f, name: 'o' }
        
        1 Reply Last reply Reply Quote 0
        • Q
          QuaDgf last edited by

          So simple and I didn’t understand it 😕

          thank you 😊

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