1 Reply Latest reply: May 29, 2018 12:08 PM by Vegard Bakke RSS

    Can't get sorting a qListObject by expression to ignore 'select state'

    Vegard Bakke

      I've created a qListObject that I'd like to be sorted by an expression (descending).

       

      The sorting works, initially. But as soon as I make a selection, the qSortByState kicks inn, and the selected value ends up first in the list.


      I have tried turning off the qSortByState in a number of different ways. Here is my current code:


       

      app.createList({

       

          "qFrequencyMode": "N",

          "qDef": {

                  "qFieldDefs": [

                          "RegionName"

                  ],

                  "qSortCriterias": [

                       {

                          "qSortByFrequency": 0,

                          "qSortByNumeric": 0,

                          "qSortByAscii": 0,

                          "qSortByLoadOrder": 0,

                          "qSortByExpression": -1,

                          "qExpression": {

                              "qv": "=RegionNo"

                          },

                          "qSortByState": 0

                      }

                  ],

                  "qAutoSortByState": {

                    "qDisplayNumberOfRows": -1

                  }

          },

          "qExpressions": [],

          "qInitialDataFetch": [

                  {

                          "qHeight": 200,

                          "qWidth": 3

                  }

          ],

          "qLibraryId": null

      }, onDataRegion);

       

       

      Can anyone spot a problem?