koalyptus / TableFilter

A Javascript library making HTML tables filterable and a bit more :)
https://www.tablefilter.com
MIT License
324 stars 95 forks source link

FIXED: Thanks....lower case not sorting as case insensitive #765

Closed Pajservices closed 4 years ago

Pajservices commented 4 years ago

Just trying to sort a table of data and the lower case items appear to be sorted first - even though I have the case_sensitive: false, set.

Reproduction steps:

  1. Create Data Table that includes the following text in column 0

"Crane Tracks, MANUAL OVERHEAD TRAVELLING CRANE TRACK (GAS PLANT)" "Fall Arrest Equipment, FALL ARREST LANYARD" "Trestle / Stand, LOAD SHAFT SUPPORT STAND" "Winch, Manual, FALL ARRESTER/WINCH (FITTED TO RESCUE SHEERLEGS)" "forklift Attachment 6Mts, FORK LIFT TRUCK FORK EXTENSIONS"

  1. Set the Configuration parameters as follows; case_sensitive: false,

Expected behavior:

I expected the lower case "forklift...."to be sorted within the rest of the table - after 'Fall..." case insensitive wise

Observed behavior:

lower case sorts first

TableFilter version: Latest as at 8th Feb 2020 Browser and version: Chrome 80.0.3987.87 OS and version: Windows Server 2019 with IIS10

Additional information:

cjohnsonuk commented 4 years ago

I had an issue previously where the case of my config didn't match the case of the config in the documentation , eg for example : Case_Sensitive: false, instead of case_sensitive: false,

I was looking for something much more complicated than it really was

It was an easy one to overlook and a quick and easy check to carry out. HTH

koalyptus commented 4 years ago

Hi @Pajservices,

the case_sensitive option is used to define the filter matching behaviour, it does not apply to column sorting.

Based on this example configuration in col_types define the column you want to make case insensitive by using the caseinsensitivestring value.

Alternatively, you could also define it at the sort configuration level, ie:

...
extensions: [{ 
  name: 'sort',
  types: ['caseinsensitivestring']
}]
...

Be aware you can also create custom sorters if you need to, this example gives an idea how to achieve that: https://www.tablefilter.com/sort-custom-type.html

Cheers

Pajservices commented 4 years ago

Thank you so much that works a treat.

Didn't spot that 'type' - but tested and great.

Regards

Phil Jones

From: koalyptus notifications@github.com Sent: 11 February 2020 03:06 To: koalyptus/TableFilter TableFilter@noreply.github.com Cc: Phil Jones phil@pajservices.co.uk; Mention mention@noreply.github.com Subject: Re: [koalyptus/TableFilter] lower case not sorting as case insensitive (#765)

Hi @Pajservices https://github.com/Pajservices ,

the case_sensitive option is used to define the filter matching behaviour https://github.com/koalyptus/TableFilter/wiki/1.02-Main-features , it does not apply to column sorting.

Based on this example https://www.tablefilter.com/sort.html configuration in col_types define the column you want to make case insensitive by using the caseinsensitivestring value.

Alternatively, you could also define it at the sort configuration level, ie:

... extensions: [{ name: 'sort', types: ['caseinsensitivestring'] }] ...

Be aware you can also create custom sorters if you need to, this example gives an idea how to achieve that: https://www.tablefilter.com/sort-custom-type.html

Cheers

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/koalyptus/TableFilter/issues/765?email_source=notifications&email_token=AGHHW6DC3QH3IQKEZT4HQELRCIIYJA5CNFSM4KSC2D32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELLCTJY#issuecomment-584460711 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHHW6DELZC6JLCZLLJCVYLRCIIYJANCNFSM4KSC2D3Q . https://github.com/notifications/beacon/AGHHW6DULTQZGNNT3DFLHO3RCIIYJA5CNFSM4KSC2D32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELLCTJY.gif

Pajservices commented 4 years ago

Not sure if anyone can help me with this, a bit cheeky I know but struggling.

I am using the tablefilter and it works really well. I have a table, and on each row is a check box – used to select items to be passed to another process.

On Click of a check box I have a function in JS that counts how many have been checked so far and displays the number. Also works by allowing me to Click – hold SHIFT – and Click further down to check a list of rows.

Unfortunately, when the table is filtered and I Click-SHIFT-Click ...it also includes the hidden rows that have been filtered out. (When clearing the filter you can see they are checked).

I am trying to figure out the code to put in my function to check if the row is hidden/filtered out or not – and if it is – uncheck it. Have tried getting the element, looking at style etc...but not working...

Any help would be much appreciated.

Regards

Phil Jones

From: koalyptus notifications@github.com Sent: 11 February 2020 03:06 To: koalyptus/TableFilter TableFilter@noreply.github.com Cc: Phil Jones phil@pajservices.co.uk; Mention mention@noreply.github.com Subject: Re: [koalyptus/TableFilter] lower case not sorting as case insensitive (#765)

Hi @Pajservices https://github.com/Pajservices ,

the case_sensitive option is used to define the filter matching behaviour https://github.com/koalyptus/TableFilter/wiki/1.02-Main-features , it does not apply to column sorting.

Based on this example https://www.tablefilter.com/sort.html configuration in col_types define the column you want to make case insensitive by using the caseinsensitivestring value.

Alternatively, you could also define it at the sort configuration level, ie:

... extensions: [{ name: 'sort', types: ['caseinsensitivestring'] }] ...

Be aware you can also create custom sorters if you need to, this example gives an idea how to achieve that: https://www.tablefilter.com/sort-custom-type.html

Cheers

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/koalyptus/TableFilter/issues/765?email_source=notifications&email_token=AGHHW6DC3QH3IQKEZT4HQELRCIIYJA5CNFSM4KSC2D32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELLCTJY#issuecomment-584460711 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHHW6DELZC6JLCZLLJCVYLRCIIYJANCNFSM4KSC2D3Q . https://github.com/notifications/beacon/AGHHW6DULTQZGNNT3DFLHO3RCIIYJA5CNFSM4KSC2D32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELLCTJY.gif

Pajservices commented 4 years ago

Quick Question re Tablefilter

When using a ‘Select’ Filter the drop down list is quite long, but when using ‘multiple’ it seems to be limited to 3 or 4 lines

Is it possible to change the length of the drop down box – maybe in CSS or a config option?

Thanks in Advance

Regards

Phil Jones

PAJ Services

From: koalyptus notifications@github.com Sent: 11 February 2020 03:06 To: koalyptus/TableFilter TableFilter@noreply.github.com Cc: Phil Jones phil@pajservices.co.uk; Mention mention@noreply.github.com Subject: Re: [koalyptus/TableFilter] lower case not sorting as case insensitive (#765)

Hi @Pajservices https://github.com/Pajservices ,

the case_sensitive option is used to define the filter matching behaviour https://github.com/koalyptus/TableFilter/wiki/1.02-Main-features , it does not apply to column sorting.

Based on this example https://www.tablefilter.com/sort.html configuration in col_types define the column you want to make case insensitive by using the caseinsensitivestring value.

Alternatively, you could also define it at the sort configuration level, ie:

... extensions: [{ name: 'sort', types: ['caseinsensitivestring'] }] ...

Be aware you can also create custom sorters if you need to, this example gives an idea how to achieve that: https://www.tablefilter.com/sort-custom-type.html

Cheers

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/koalyptus/TableFilter/issues/765?email_source=notifications&email_token=AGHHW6DC3QH3IQKEZT4HQELRCIIYJA5CNFSM4KSC2D32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELLCTJY#issuecomment-584460711 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AGHHW6DELZC6JLCZLLJCVYLRCIIYJANCNFSM4KSC2D3Q . https://github.com/notifications/beacon/AGHHW6DULTQZGNNT3DFLHO3RCIIYJA5CNFSM4KSC2D32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOELLCTJY.gif