case sensitive preselect in searchpanes
case sensitive preselect in searchpanes
Khalid Teli
Posts: 251Questions: 71Answers: 0
HI @sandy
I was trying to use thesearchPanes preselect options
to select some values from search panes. However it appears to be case sensitive , for example if I use : preSelect: ['edinburgh','London']
, it will only select rows with location as London.
How can I select the both locations ?
live.datatables.net/labasobo/1/
Thank you
Kind Regards,
K Teli
This question has an accepted answers - jump to answer
Answers
Hi @Khalid Teli ,
Sorry I might be being daft here but why can you not just capitalise the "e" to select the correct option? See here.
Thanks,
Sandy
Hi @sandy
Yes, I can.
In my actual use case , I use a external variable in preSelect where I get the information from cookie , for example
var abc= ['Choclate milk', 'Cookies','Butter cream' ].
In my database these are saved as
['Choclate Milk', 'Cookies','Butter Cream' ]
(first character of each word is Uppercase). So in order to correctly select these values from DB , I will have to use javascript function to make the first character of each word Uppercase invar abc
.Which is not an issue , I was just wondering if there is a way to not make these preSelect values case sensitive so I won't have to write a function to change the first characters of each word to Uppercase.
Thank you
Kind Regards,
KT
For most use cases, those two strings would want to be treated differently, as they are effectively different strings. The simplest way for you would be to either store the cookie with the correct casing, or change it upon retrieval.
Colin
@collin Thank you