quasar icon indicating copy to clipboard operation
quasar copied to clipboard

[Request] - Qtree - Ability to specify a different label field than 'label'

Open mgibson91 opened this issue 8 years ago • 1 comments

I currently have multiple cases where data is being directly queried from a database to be displayed in a QTree.

The field name which contains the record label is 'value' although Quasar expects 'label'. I currently have a transform function which replaces the 'value' field with a 'label' field for every record.

The ability to specify, I want to the tree for each node to display the node.value field would be great and allow me to get rid of this step!

Envisioning a label-key field much like node-key.

Looking at the code, I do see that the filter method expects a label field which would seem to require a change as it is not possible to access other props i.e. label-key inside a prop default function AFAIK

    filterMethod: {
      type: Function,
      default (node, filter) {
        const filt = filter.toLowerCase()
        return node.label && node.label.toLowerCase().indexOf(filt) > -1
      }
    },

mgibson91 avatar Aug 21 '18 10:08 mgibson91

Hi, +1 for this feature. It will be nice to have this feature also for other components that use label field.

krugerpl avatar Aug 22 '18 06:08 krugerpl