Parameters for 2nd fnFilter() call contains parameters from previous calls?
Parameters for 2nd fnFilter() call contains parameters from previous calls?
![tomaspet262](https://secure.gravatar.com/avatar/d2eb96fc6972ba967951fc2e1a0516df/?default=https%3A%2F%2Fvanillicon.com%2Fd2eb96fc6972ba967951fc2e1a0516df_200.png&rating=g&size=120)
1. I call fnFilter('term for one', 1)
2. I call another fnFilter('term for two', 2)
For second fnFilter() call, these parameters were sent to the server:
[code]
...
sSearch_1: 'term for one'
bRegex_1: false
bSearchable_1: true
sSearch_2: 'term for two'
bRegex_2: false
bSearchable_2: true
...
[/code]
=> Params from previous searches are included. Is it possible to have params only from current call? In the manner that params send to server for second fnFilter() call would be:
[code]
...
sSearch_1: ''
bRegex_1:false
bSearchable_1:true
sSearch_2: 'term for two'
bRegex_2: false
bSearchable_2: true
...
[/code]
Thanks in advance.
2. I call another fnFilter('term for two', 2)
For second fnFilter() call, these parameters were sent to the server:
[code]
...
sSearch_1: 'term for one'
bRegex_1: false
bSearchable_1: true
sSearch_2: 'term for two'
bRegex_2: false
bSearchable_2: true
...
[/code]
=> Params from previous searches are included. Is it possible to have params only from current call? In the manner that params send to server for second fnFilter() call would be:
[code]
...
sSearch_1: ''
bRegex_1:false
bSearchable_1:true
sSearch_2: 'term for two'
bRegex_2: false
bSearchable_2: true
...
[/code]
Thanks in advance.
This discussion has been closed.
Replies
fnFilter('',1);
fnFilter('term for two', 2);
Maybe, if there would be option to pass all params within one call, it will be good solution.
http://www.datatables.net/plug-ins/api#fnMultiFilter
Anyway, I did it with adding 3 lines of code in the jquery.dataTables.js, within this.fnFilter function, starting on line 1560:
[code]
/* Delete previous single-column searches */
for(var i in oSettings.aoPreSearchCols)
oSettings.aoPreSearchCols[ i ].sSearch = '';
oSettings.oPreviousSearch.sSearch = '';
[/code]
Nevertheless, thank you for you time and tips!