Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with ColReorder and column without filter #461

Closed
felipekoblinger opened this issue Apr 22, 2018 · 3 comments
Closed

Problem with ColReorder and column without filter #461

felipekoblinger opened this issue Apr 22, 2018 · 3 comments
Labels

Comments

@felipekoblinger
Copy link

Hello! First of all, I'm not sure if it is a bug, I've tried to find an answer, sorry if I'm mistaken.
Versions used: 0.92 and 0.93.beta.18.

I have a table with 7 columns, the last one (index 6) is an action column without filtering. So, I didn't set an object with "column_number: 6" for that column and worked as expected, the filter wrapper "yadcf-filter-wrapper" wasn't generate on it. Then, I've added ColReorder extension and everything was working until I moved a column to action column index (6) position. After that, I couldn't search anything and this error shows up:

Cannot read property 'case_insensitive' of undefined
at yadcfMatchFilter (jquery.dataTables.yadcf.js:816)

YADCF seems to use index 6 to get filter information, but it doesn't exist. It wasn't suppose to change accordingly on moving?

This is my array of objects for YADCF initialization.

[
  {
    "column_number": 0,
    "filter_type": "text",
    "style_class": "form-control"
  },
  ...
  {
    "column_number": 5,
    "filter_type": "select",
    "style_class": "form-control"
  }
]

I've found a fix, setting index 6 in the array and passing a "display: none" class to "style_class". Like this:

{
  "column_number": 6,
  "style_class": "d-none",
  "filter_reset_button_text": false
}

Is there a proper way to hide/disable a column for filtering?

Thanks 😄

@felipekoblinger felipekoblinger changed the title Column filter and ColReorder Problem with ColReorder and column without filter Apr 22, 2018
@vedmack
Copy link
Owner

vedmack commented Apr 22, 2018

Hi

Please make sure you got the latest ColReorder js/css and if it still does not work, please provide a test page jsfiddle/etc

@felipekoblinger
Copy link
Author

Hello, @vedmack!
I'm using the latest version of ColReorder (1.4.1) with latest version of DataTables (1.10.16).

I've made the JSFiddle to exemplify: https://jsfiddle.net/m72dcmbg/9/

  • Move Values column into Tags column position, then try to type anything to filter, nothing is filtered and the error appears on console.

If I hide the column filter with "style_class" instead, it works.
Working: https://jsfiddle.net/qjnm2xq7/1/

=)

@vedmack vedmack added the bug label Apr 23, 2018
vedmack added a commit that referenced this issue Apr 26, 2018
fixed / improved a bit
#455
#461
@vedmack
Copy link
Owner

vedmack commented Apr 26, 2018

fixed in 0.9.3.beta.20

@vedmack vedmack closed this as completed Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants