Cascasepane true shows multiple count in filter change function

Cascasepane true shows multiple count in filter change function

valredrvalredr Posts: 21Questions: 7Answers: 0

Hi,
i have used search pane and then switched on the cascade pane option but if i select values from the pane the filter change function executes twice.

find below test case.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,177Questions: 1Answers: 2,590

    Can you repost, please, the test case is missing,

    Colin

  • valredrvalredr Posts: 21Questions: 7Answers: 0

    @colin Apologies please find below the test case

    http://live.datatables.net/kowapasi/15/edit

  • colincolin Posts: 15,177Questions: 1Answers: 2,590

    Yep, I'm seeing that in this cut-down example here. I've raised it internally (DD-2120 for my reference) and we'll report back here when there's an update.

    Cheers,

    Colin

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @valredr ,

    I've made a change to try and reduce the number of calls to searchPanes.filterChanged. Unfortunately this is hard to reduce further given searchPanes.cascadePanes complex functionality - there's a lot of moving parts and edge cases that need to be covered!

    This will be available in the next SearchPanes release which we hope will be in the next few weeks. Until then you can access the fix from the nightly builds.

    Thanks,
    Sandy

  • sandysandy Posts: 913Questions: 0Answers: 236

    Take a look at this example with the updated nightly build.

    Thanks,
    Sandy

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @valredr ,

    Another way to reduce the number of times the code in that function runs would be to put a throttle function within it.

    Thanks,
    Sandy

  • valredrvalredr Posts: 21Questions: 7Answers: 0

    @sandy Can you please share an example of how to implement the throttle function in this case

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @valredr ,

    Sure take a look at this example. The docs for the throttle function can be found at $.fn.dataTable.util.throttle().

    Hope this helps,
    Sandy

  • valredrvalredr Posts: 21Questions: 7Answers: 0

    @sandy Thanks you very much this was quite helpful

Sign In or Register to comment.