Quasar Tree returning too much data when all items are selected

Open
#8,008 10 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
frontend

Research direction

Start with the Quasar Tree component's selection and returned-value behavior, then compare it with the vue-treeselect valueConsistsOf examples linked in the issue. Verify how selecting a branch currently expands to its descendants and define completion as returning selected branches instead when all their children are selected, without requiring every leaf in the result.

Written by the indexing model from the issue text.

Description

kind/feature 💡

I'm using the Quasar Tree to have a compact control in which to include Regions, Countries, and States from around the world, for a search criteria. I'm currently using the vue-treeselect to do this
https://vue-treeselect.js.org/#node

However, I would prefer to use the Quasar Tree, but the data that is being returned is far more verbose than vue-treeselect, and results in a significantly more complicated SQL query when returned to the server.

vue-treeselect, simply returns ["All"] when the root node is checked, or ["Europe", "NorthAmerica"] when only those items are selected.

The problem I'm having with Quasar's Tree component, is that it's returning every Country and State in Europe and North America instead. Obviously this includes 50 states for the USA alone, so a lot more data is being generated than necessary. And instead of the server simply saying "where Region = 'NorthAmerica'" it is instead having to do "where State='Alabama' or State='Alaska' or State='Arizona'" etc., which is very inefficient, and puts unnecessary stress on the database server.

The vue-treeselect component achieves this using a "valueConsistsOf" prop.
https://vue-treeselect.js.org/#prevent-value-combining

If you quickly play with this link, you can see how the Quasar Tree effectively uses "Leaf priority", whereas it would be much more efficient for most people to use the "Branch priority" option, which is the default option for vue-treeselect.

Dominant language
JavaScript
Stars
27.2k
Forks
3.7k
Avg merge
1d 22h
Merged PRs (30d)
11

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quasarframework/quasar

All issues in quasarframework/quasar

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.