qlik-oss / nebula.js

Product and framework agnostic integration APIs for Qlik's Associative Engine
https://qlik.dev/extend/set-up-nebula-environment/
MIT License
78 stars 56 forks source link

Add options to the internal listbox #668

Closed MarkFereday closed 1 year ago

MarkFereday commented 3 years ago

🚀 Feature

Using the internal listbox to present a field filter has no options for e.g. sorting

Motivation

A very common use-case in a mashup, add filters with a defined sort, or a sort changeable by the user

Additional context

Raised on QlikBranch, recommended to raise as issue here. See also https://github.com/qlik-oss/nebula.js/pull/654

Caele commented 3 years ago

This should work for you for now:

nebbie.field('[My Field]').then((s) =>
      s.mount(document.querySelector('.listbox'), {
        properties: {
          qListObjectDef: {
            qDef: {
              qSortCriterias: [
                {
                  qSortByState: 0,
                  qSortByAscii: 1,
                  qSortByNumeric: 1,
                  qSortByLoadOrder: 1,
                },
              ],
            },
          },
        },
      })
    );

Will keep this open as the current solution requires very intimite knowledge of the hyperCube properties. Sorting should be simpler.

MarkFereday commented 3 years ago

Thanks, I'll try this ASAP

Caele commented 1 year ago

Closing as no more work on options are planned, will instead point to the coming filterpane chart.