Individual Column Filtering

Individual Column Filtering

28.vivek.s28.vivek.s Posts: 69Questions: 0Answers: 0
edited August 2010 in Bug reports
First of all i would like to thank for this awsome plugin.
i m working with dataTable plugin 1.7. i m using individual column filtering function

[code]oTable.fnFilter([container],iColumn,true,true,false);[/code]

but i came up with some problem.
if i give input smthing like A & B|AB its not getting filtered.i got output
"No matching Records Found".i enabled both bRegx and bSmart,like it is in fallowing example

http://datatables.net/beta/1.7/examples/api/regex.html

in this example if i checked both Treat as regex and Use smart filter, and give input smthing like i gave in my code..for exmp.
Firefox 1.0 & A|Netscape 7.2
then its not getting filtered.

guys please help me out...

thanks in advance.
vivek

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I don't quite get what you are trying to do - if I put in "Firefox 1.0 & A|Netscape 7.2" into column 1, with bRegex checked into the example you pointed at, there are correctly no matched found. There is no string "Firefox 1.0 & A" in any of the individual columns in the example - indeed there is no ampersand in the table at all, which means nothing will match with it.

    Allan
  • 28.vivek.s28.vivek.s Posts: 69Questions: 0Answers: 0
    edited August 2010
    Thanks Allan for your quick reply.
    sorry to not elaborate the problem properly....

    actually i changed the Firefox 1.0 to Firefox 1.0 & A in second column and then tried to filter with this input

    Firefox 1.0 & A|Netscape 7.2

    with both bRegx And bSmart enabled and then i got ''no matching records found''.

    if i enabled only bRegx then i m getting only second string that is Netscape 7.2
    and if i enabled bSmart then i m getting only the first string that is Firefox 1.0 & A

    i also tried this with dataTables 1.6 but here, because of '&' the string is not getting filtered.i also escaped the '&' but still problem remains same.
    [code]oTable.fnFilter(sInput,2,false)[/code]
    also,i used global filter,but i didn't get the desired output.

    i am using my own regular expression to escape '&'

    please help me out...

    vivek
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    & isn't a regular expression 'key character' in Javascript - so you can't escape it (or you can try, but it won't do anything :-) ). There is no letter '&' in the table, so it is always going to fail to match when you put an '&' into the filter. Are you looking for a logical AND? I'm not a regular expression expert, but this is a great site for regex info: http://www.regular-expressions.info/

    Allan
This discussion has been closed.