Vue 2 - Flexgrid sort column descending after entering value

Posted by: eric.devwise on 11 March 2019, 12:19 am EST

    • Post Options:
    • Link

    Posted 11 March 2019, 12:19 am EST

    I need to be able to sort a column to descending after a user inputs a number into a specific column’s cell.

    I read about SortDescriptions, but I still don’t understand how I would use it or if it is the right way to go.

  • Posted 13 March 2019, 12:39 am EST

    Hi,

    We could simply create an instance of SortDescription and push it on the sortDescriptions property of the collectionView.

    Please refer to the following code snippet and sample:

    // create sort desc
          let sd = new wjcCore.SortDescription("id", false);
          // clear previous sort
          this.grid.collectionView.sortDescriptions.clear();
          // push on collectionView's sortDescriptions property
          this.grid.collectionView.sortDescriptions.push(sd);
    

    https://codesandbox.io/s/n6mv8qrom

    ~Sharad

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels