SearchPanes plugin and fuzzySearch

SearchPanes plugin and fuzzySearch

mvwieringenmvwieringen Posts: 12Questions: 1Answers: 0

Hi,

I'm trying to use the fuzzySearch plugin in combination with searchPanes but that doesn't seem to work.
I get the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'rankColumn')
at Array.<anonymous> (dataTables.fuzzySearch.js:191)
at Sb (dataTables.min.js:68)
at za (dataTables.min.js:68)
at ka (dataTables.min.js:56)
at B.<anonymous> (dataTables.min.js:137)
at B.iterator (dataTables.min.js:130)
at B.<anonymous> (dataTables.min.js:137)
at B.draw (dataTables.min.js:133)
at h._buildPane (dataTables.searchPanes.min.js:78)
at h.rebuildPane (dataTables.searchPanes.min.js:54)

When using fuzzysearch in an other table without searchPanes it works aright e.g. I initialize
fuzzysearch to use the toggleSmart option.

So I get the feeling that the searchPanes search boxes are playing up here.

Marco

Replies

  • mvwieringenmvwieringen Posts: 12Questions: 1Answers: 0

    Ok found a workaround.

    --- a/public/js/dataTables.fuzzySearch.js
    +++ b/public/js/dataTables.fuzzySearch.js
    @@ -188,7 +188,7 @@
                     // Return the value for the pass as decided by the fuzzySearch function
                     return settings.aoData[dataIndex]._fuzzySearch.pass;
                 }
    -            else if (initial.rankColumn !== undefined) {
    +            else if (initial !== undefined && initial.rankColumn !== undefined) {
                     settings.aoData[dataIndex].anCells[initial.rankColumn].innerHTML = '';
                     settings.aoData[dataIndex]._aSortData[initial.rankColumn] = '';
                 }
    
  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Good one. SearchPanes won't work with the ranking column, so you'd probably be best to use searchPanes.columns to make sure that the ranking column wouldn't be included.

    What do you think of the fuzzy search?

    Allan

  • mvwieringenmvwieringen Posts: 12Questions: 1Answers: 0

    Hi,

    I think its more that searchPanes DT tables don't have any fuzzySearch settings and as such the initial variable will be undefined for those panes. I'm not using rank columns (not plan on doing so.) I would however like to be able to use
    the toggle option also in searchpanes but setting fuzysearch according to the example for an normal datatable using the dtOpts setting of searchpanes doesn't yield anything.

    As to fuzzy searching not sure if it will be handy but as an option using the toggleSmart option is simple and usable.

    Marco

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Hi Marco,

    Many thanks - we'll built up local example of FuzzySearch and SearchPanes and see if we can get to the bottom of this.

    Allan

Sign In or Register to comment.