How does draw() work? What does it use to display the result?

How does draw() work? What does it use to display the result?

prahithaprahitha Posts: 2Questions: 1Answers: 0

Debugger code (debug.datatables.net):

table = $('#report_table').DataTable();
var api = table;
api = api.context[0];
api = api.aoPreSearchCols;
for(var i=0; i<4; i++){
// want to change columns 2-5
api[i+2].bRegex = true;
api[i+2].bSmart = false;
api[i+2].sSearch = values[i];
}

Description of problem:
I want to perform a logical OR operation between the columns for a regex search query.
I tried the global search table.search() but it didn't seem to work for regex. Then I tried table.columns().search() but this returned the logical AND, which I believe is because the search is subtractive. So I tried manipulating the API instance and updated the sSearch of each column which is stored in the values array. I then tried table.draw() but got back the same result. Any help in how to implement this is appreciated, thank you!

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    Answer ✓

    This example should help. Kevin implemented OR logic for it - it would be worth using that as a starting point,

    Colin

  • prahithaprahitha Posts: 2Questions: 1Answers: 0

    Thank you! It helped :)

Sign In or Register to comment.