Issues with sorting in FlexSheet

Posted by: holly.anderson on 1 December 2017, 12:21 pm EST

    • Post Options:
    • Link

    Posted 1 December 2017, 12:21 pm EST

    Hello,

    I’m experiencing a couple issues with sorting in FlexSheet (version 5.20173.380). The attached sample illustrates both problems.

    1. When I sort by multiple columns, the first column is moved to the end of itemsSource.sortDescriptions instead of the beginning. For example, if I first sort by column C and then by column A, the FlexSheet sorts by column A first and then by C. I would expect this to be the other way around. Is there some way to change this behavior?

    2. As far as I know, there is no way in the UI to “unsort” a column. I’ve implemented a button which unsorts the FlexSheet by clearing the sort descriptions. This does indeed unsort the columns. The problem is that if I sort a column again after clearing the sort descriptions, the old sort descriptions appear again. Is there some other way that I should be unsorting columns?

    Thanks,

    Holly

    FlexSheetDemo_Sort.zip

  • Posted 4 December 2017, 5:56 am EST

    Hi,

    We are looking into it. I will get back to you on this tomorrow.

    Thanks,

    Abhishek

  • Posted 5 December 2017, 5:59 am EST

    Hi Holly,

    We are sorry for the inconvenience. We are able to replicate both of the issue at our end and it seem bug. Hence, both of the issues has been escalated to the concerned team for further investigation with internal tracking id 299490.

    We will let you know as we get any update.

    ~Manish

  • Posted 15 December 2017, 3:45 pm EST

    I noticed that in the latest pre-release build, sorting by multiple columns is not possible through the UI. While this solves issue #1, it is not the resolution I was expecting. Do you know if there are plans to allow multi column sort?

  • Posted 18 December 2017, 7:39 am EST

    Hi,

    This is the design behavior FlexGrid too. However, I have queried to the concerned team for the same.

    We will let you know as we get any update on this.

    ~Manish

  • Posted 20 December 2017, 10:08 am EST

    Hi Holly,

    The multiple columns sort has been added back. But the recent column will be at highest priority same as MSExcel.

    ~Manish

  • Posted 21 December 2017, 9:44 am EST

    Hi Manish,

    Thanks for the update. I just tried this out in the latest pre-release build, and I’m running into issue #2 again.

    Regarding multi-column sort, if the most recently sorted column will take highest priority, I’d rather not give users the option to sort by multiple columns. Is there some way (e.g. property, workaround) that I could either (1) prevent multi-column sort or (2) override the default behavior so that the most recently sorted column will have the lowest priority?

    Thanks,

    Holly

  • Posted 22 December 2017, 3:17 am EST

    Hi Holly,

    If you would like to remove all previous sorting, you need to handle mousedown event for filter’s sort button and clear flexSheet sortManager using clearSort method.

    If you would like to reverse the order, you need to handle click event for filter’s sort button and reverse the order for current sort, push the sort in sortDescriptions and remove previous applied sorting.

    Please refer to the attached sample for the same.

    ~Manish

    FlexSheetDemo_Sort.zip

  • Posted 30 December 2017, 3:48 pm EST

    Hi Manish,

    Thanks for the information. I have a few questions about sortManager.

    1. What’s the difference between sheet.itemsSource.sortDescriptions, sheet.collectionView.sortDescriptions, and sheet.sortManager.sortDescriptions? When should one be used over the others?

    2. I can’t find any documentation on the sortManager.clearSort method. Could you point me in the right direction?

    3. I notice that when I create a new FlexSheet, sortManager.sortDescriptions contains one item with a columnIndex of -1. And when I call sortManager.clearSort(), that item is removed (along with any others). What is the purpose of this item?

    Thanks,

    Holly

  • Posted 2 January 2018, 2:17 am EST

    Hi Holly,

    Here are the answers for your queries:

    1)

    sheet.itemsSource.sortDescriptions will be return undefined if sheet itemsSource is not a CollectionView object.

    sheet.collectionView.sortDescriptions is used to apply sorting for bound sheet. The sorting can not be applied for unbound sheet using collectionView.

    sheet.sortManager.sortDescriptions is used to allow sorting for unbound sheet too along with boundSheet using column Index instead of bounding by passing ColumnSortDescription object in sortDescriptions.

    Please refer to Sorting section in FlexSheet introduction demo:

    http://demos.wijmo.com/5/angular/FlexSheetIntro/FlexSheetIntro/

    SortManager.clearSort method has been added in the recent maintenance build after 5.20173.380. Hence, this method is documented in the current documentation for 5.20173.380 build.

    If you would like to find updated documentation, you may get it in downloaded latest maintenance build folder at following location:

    Samples/Angular/WijmoHelp

    This is added to provide a default one column as the demo for sorting.

    http://demos.wijmo.com/5/angular/FlexSheetIntro/FlexSheetIntro/

    ~Manish

  • Posted 12 January 2018, 9:12 am EST

    Hi Manish,

    So if I’m using a FlexSheet with a bound sheet and an itemsSource that is a CollectionView object, does it matter if I use sheet.itemsSource.sortDescriptions or sheet.collectionView.sortDescriptions? Or would they be equivalent?

    Thanks,

    Holly

  • Posted 15 January 2018, 8:24 am EST

    Hi Holly,

    In this case, both would be equivalent.

    ~Manish

Need extra support?

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

Learn More

Forum Channels