Sorting with Grouping grid (Pure JS mode)

Posted by: m.omar on 17 March 2018, 8:34 pm EST

    • Post Options:
    • Link

    Posted 17 March 2018, 8:34 pm EST

    Salam Alykom

    I have a wijmo 5 grid in “Pure JS mode” with sorting and grouping features.

    In case that user click on columns headers in purpose of sorting , sort applied without respect current grouping result, in anther words my question is can i apply sorting within the scope of each groups ?

  • Posted 18 March 2018, 5:07 pm EST

    Hi Omar,

    As we understand, your requirement is following:

    On clicking column header, Group should not be sorted instead items for Group should be sorted.

    For e.g. Grouping is applied to the Country column and Date header is clicked for Sorting. While Sorting applied, Group position gets changed. And as per your need it should not.

    Please confirm this…

    ~Manish

  • Posted 19 March 2018, 6:35 pm EST

    Any update ?

  • Posted 19 March 2018, 6:36 pm EST

    YES , confirmed …

  • Posted 19 March 2018, 11:35 pm EST

    Hi,

    We are looking into it. We will revert back to you on this soon.

  • Posted 20 March 2018, 12:17 am EST

    Hi Omar,

    For this, we need to cancel default sorting and push the sort descriptions for Grouped Column too along with current column.

    Please refer to the following code snippet and find the attached sample:

    
    flex.sortingColumn.addHandler(function(s,e){
                   e.cancel=true;
                   var _sort= s.columns[e.col].currentSort;
                   var _cSort;
                   if(_sort){
                       _sort =="+" ? _cSort=false : _cSort= true; 
                   }
                   cvData.sortDescriptions.clear();               
                   var sd= new wijmo.collections.SortDescription(s.columns[e.col].binding, _cSort )
                   cvData.sortDescriptions.push(new wijmo.collections.SortDescription("country",true));
                   cvData.sortDescriptions.push(new wijmo.collections.SortDescription("date",true));
                   cvData.sortDescriptions.push(sd);
                })
    
    

    ~Manish

    FlexGrid-preventSorting-groups.zip

  • Posted 21 March 2018, 1:36 am EST

    Thanks alot …

Need extra support?

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

Learn More

Forum Channels