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

    Prevent selection of some rows in q-table

    Help
    2
    3
    360
    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.
    • carrypotter
      carrypotter last edited by

      Hello, I have a QTable with selection enabled. I would like to prevent the selection of some rows under certain conditions (for example when some cells of the row are empty or contain certain values).
      What is the best strategy to use?

      Thanks in advance

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

        @carrypotter you will probably need to use body slot and do the logic there, ie. ... <q-td ...><q-checkbox :value="props.selected" @input="v => { props.row.somedata ...<your condition> ? props.selected = v : ...do nothing }" .../>.

        1 Reply Last reply Reply Quote 1
        • carrypotter
          carrypotter last edited by

          Thanks @metalsadman. I solved with update:selected event where i check and remove invalid selected row.

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