Maximum call stack exceeded when searching for between dates.

Maximum call stack exceeded when searching for between dates.

fiji885fiji885 Posts: 7Questions: 3Answers: 0

Link to test case: https://jsfiddle.net/oqxurv6z/4/
Debugger code (debug.datatables.net): https://debug.datatables.net/azoboy

Error messages shown:

jquery.dataTables.js:7312 Uncaught RangeError: Maximum call stack size exceeded
    at _Api.i18n (jquery.dataTables.js:7312)
    at conditionName (dataTables.searchBuilder.js:1484)
    at Criteria._populateCondition (dataTables.searchBuilder.js:712)
    at Criteria.rebuild (dataTables.searchBuilder.js:349)
    at Group.redrawContents (dataTables.searchBuilder.js:2546)
    at HTMLDivElement.<anonymous> (dataTables.searchBuilder.js:3423)
    at HTMLDivElement.dispatch (jquery-3.6.0.js:5430)
    at HTMLDivElement.elemData.handle (jquery-3.6.0.js:5234)
    at Object.trigger (jquery-3.6.0.js:8719)
    at HTMLDivElement.<anonymous> (jquery-3.6.0.js:8797)

Description of problem: I want to use flex display so I can get the remove button right to the right of the SearchBuilder criteria. Everything works except between date searching. It's giving max call stack error. Not sure how to go about solving this...

You can replicate this by selecting Date of Birth in the dropdown, and then selecting between for the condition. Once you select a date, a you will get Maximum call stack exceeded error.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    It looks like the problem has been resolved in an unreleased edit - I updated your example to use the nightly builds, see here, and the problem is no longer occurring. You can find the nightly releases here. Could you look at that, please, and see if it helps. If it's still not working for you, please can you update my example, or link to your page, so that we can see the problem. We're likely to release these changes in the next fortnight.

    Cheers,

    Colin

  • fiji885fiji885 Posts: 7Questions: 3Answers: 0

    Thank you for your reply, Colin. The error still persists. The css for .dtsb-criteria must be flex. I have modified your example below:

    http://live.datatables.net/gosonevo/5/edit

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Ah, yep. Thanks for that tweak. I've raised it internally (DD-2352 for my reference) and we'll report back here when there's an update - hopefully within the coming week.

    Cheers,

    Colin

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

    Hi @fiji885 ,

    Setting the width to be flex on .dtsb-criteria works against the responsive integration that is within SearchBuilder, which is what causes the infinite loop. I'm afraid that to achieve what you want you are going to have to take a different approach as at the moment this isn't supported.

    Thanks,
    Sandy

Sign In or Register to comment.