Sorting displayed in filter menu when switched off

Posted by: stephen.young on 2 October 2018, 4:06 am EST

    • Post Options:
    • Link

    Posted 2 October 2018, 4:06 am EST

    If I set allowSort to false in the projectionOptions section of the ssjson template it stops the grid from being sorted but the option is still there for the users. When they select it nothing happens as expected but having the option there is confusing. If sorting is turned off can the option be hidden?

    "protectionOptions": {
        "allowSort": false
    }
    
  • Posted 3 October 2018, 1:20 am EST

    Hello,

    You need to hide the sort options from the filter dropdown as given below:-

         oldOpenDialogFun = GC.Spread.Sheets.Filter.HideRowFilter.prototype.openFilterDialog;
            GC.Spread.Sheets.Filter.HideRowFilter.prototype.openFilterDialog = function (filterButtonHitInfo) {
                oldOpenDialogFun.apply(this, arguments);
                setTimeout(function () {
                    $(".gc-filter-sort").parent().parent().css("display", "none");
                }, 0);
            }
    
    

    Please have a look at attached sample for the same.

    Hope it helps.

    Thanks,

    Reeva

    SpreadJS_HideSortInfilterDropDown.zip

Need extra support?

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

Learn More

Forum Channels