Searchbuilder 1.7+ Issue with Legacy DataTables

Searchbuilder 1.7+ Issue with Legacy DataTables

APSMITH2367APSMITH2367 Posts: 2Questions: 1Answers: 0

Hi,

I have inherited a legacy web application built around some older Javascript frameworks. I'm working on incremental updates, and eventually would like to bring everything up to current versions of course. However in the meantime I have run into a problem trying to incorporate SearchBuilder and I think this issue is potentially something the maintainers would be interested in seeing and perhaps fixing. It could also be my usage, either way I appreciate any suggestions and/or fixes!

For this example I used the legacy DataTables builder found here: https://datatables.net/legacy/v1/download/

Here is a test case: https://live.datatables.net/yitekixo/1

To reproduce:

  1. click 'Add Condition'
  2. from Data dropdown choose 'Name'
  3. from Condition dropdown choose 'Equals'

An error appears on the console:

    TypeError: fastData is not a function
        at Criteria.initSelect [as init] (dataTables.searchBuilder.js:1046:30)
        at Criteria._clearValue (dataTables.searchBuilder.js:642:80)
        at HTMLSelectElement.<anonymous> (dataTables.searchBuilder.js:555:31)
        at HTMLSelectElement.dispatch (jquery-1.12.4.js:5226:27)
        at elemData.handle (jquery-1.12.4.js:4878:28)

Interestingly, if I back the SearchBuilder version down to 1.6.0 the problem does not occur, which is my workaround for the time being. However issue seems to be present in the "latest" versions of SearchBuilder (1.7.0 and 1.7.1).

Thank you!
-Andy

Answers

  • allanallan Posts: 63,441Questions: 1Answers: 10,459 Site admin

    Hi Andy,

    You are absolutely correct - my apologies, I clean missed that. Because of that API change, SearchBuilder 1.7 is not compatible with DataTables 1.x. The older SB 1.6 release would indeed need to be used.

    I've updated the versions for the legacy download builder.

    Regards,
    Allan

  • kthorngrenkthorngren Posts: 21,299Questions: 26Answers: 4,944

    @allan please update the SB 1.7.0 release not to remove the 1.x compatibility note.

    Kevin

  • allanallan Posts: 63,441Questions: 1Answers: 10,459 Site admin

    Good point - thanks Kevin.

    If I'd realised it would have been a v2 release. I might go back and see what will be involved in making it work with v1 again (not sure when I'll get to that - quite a pile at the moment!).

    A

  • APSMITH2367APSMITH2367 Posts: 2Questions: 1Answers: 0

    Thanks for looking into this! Sounds like a good resolution. Glad I wasn't crazy... :-)

    I really appreciate the excellent work and culture in this community!

    Best,
    -Andy

Sign In or Register to comment.