0

I have situation where I'm filtering values in column "Office" with selectbox where I can select multiple values. For example I want to filter "New York" and "San Francisco" in column "Office" so I expect only first row because it contains both values. My current code shows first row and other row because they contains "New York" or "San Francisco"

Exmple http://live.datatables.net/fadixapi/1/edit?html,js,output

Solved
selected = $("#"+selectId+' option:selected').map(function(){ return "(?=.*"+this.value+")"; }).get(); table.column(2).search("^.*" + search + ".*$",true).draw();

1

1 Answer 1

1

Try this :

table.column(2)
.search("^" + search + "$", column, true, false)
.draw() ;
Sign up to request clarification or add additional context in comments.

1 Comment

in .search() what is column variable?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.