Customize Filter Popup in SpreadJSv10

Posted by: jonathancampos on 8 September 2017, 10:07 am EST

    • Post Options:
    • Link

    Posted 8 September 2017, 10:07 am EST

    I need a way to customize the filter popup in SpreadJSv10. I need the ability to change the data list that is shown in the filter. I also need to give specific columns different filter options. Any ideas of how to achieve any part of this would be helpful.

    I’ve looked at creating a custom header with a custom slicer but would want to mimic the current filter look and don’t see how to do that easily.

  • Posted 8 September 2017, 10:07 am EST

    Hi,

    I don’t know of any APIs in Spread.Sheets that can help with that – the logic to build the filter list is based on how Excel behaves and uses the unique values in the cells to build the list. The filter popup dialog isn’t exposed anywhere in the API, and there isn’t a method for showing it in script code (e.g. making the dialog show as if a user clicked inside the drop-down filter button). You would need to emulate or intercept the user’s click in the filter button, then get find the dialog in the DOM and modify its contents, which is very complicated and messy.

    I will ask the developers if there is some better way but I don’t expect they will have any better suggestion (they will suggest enhancements).

    Regards,

    -Sean

  • Posted 11 November 2017, 4:46 pm EST

    Hi Sean,

    Is it possible to expose an event like “OnBefore FilterDialogOpen”? Or Is there any way in the system today to execute my code before filter dialog pops up?

    Thanks.

  • Posted 22 December 2017, 9:51 am EST

    Hello,

    There is no event like that, as mentioned by Sean you will need to to emulate or intercept the user’s click in the filter button, then get find the dialog in the DOM and modify its contents.

    Thanks,

    Deepak Sharma

  • Posted 7 February 2018, 11:56 pm EST

    Thanks, Deepak.

    Do you have sample code on how to intercept the click event of the filter button?

Need extra support?

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

Learn More

Forum Channels