Lines 564-582
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
564 |
}; |
564 |
}; |
565 |
|
565 |
|
566 |
var filter = data.search.value; |
566 |
var filter = data.search.value; |
567 |
var query_parameters = settings.aoColumns |
567 |
// Build query for each column filter |
|
|
568 |
var and_query_parameters = settings.aoColumns |
568 |
.filter(function(col) { |
569 |
.filter(function(col) { |
569 |
return col.bSearchable && typeof col.data == 'string' && (data.columns[col.idx].search.value != '' || filter != '') |
570 |
return col.bSearchable && typeof col.data == 'string' && data.columns[col.idx].search.value != '' |
570 |
}) |
571 |
}) |
571 |
.map(function(col) { |
572 |
.map(function(col) { |
572 |
var part = {}; |
573 |
var part = {}; |
573 |
var value = data.columns[col.idx].search.value != '' ? data.columns[col.idx].search.value : filter; |
574 |
var value = data.columns[col.idx].search.value; |
574 |
part[!col.data.includes('.')?'me.'+col.data:col.data] = options.criteria === 'exact'?value:{like: (['contains', 'ends_with'].indexOf(options.criteria) !== -1?'%':'')+value+(['contains', 'starts_with'].indexOf(options.criteria) !== -1?'%':'')}; |
575 |
part[!col.data.includes('.')?'me.'+col.data:col.data] = options.criteria === 'exact'?value:{like: (['contains', 'ends_with'].indexOf(options.criteria) !== -1?'%':'')+value+(['contains', 'starts_with'].indexOf(options.criteria) !== -1?'%':'')}; |
575 |
return part; |
576 |
return part; |
576 |
}); |
577 |
}); |
577 |
|
578 |
|
|
|
579 |
// Build query for the global search filter |
580 |
var or_query_parameters = settings.aoColumns |
581 |
.filter(function(col) { |
582 |
return col.bSearchable && typeof col.data == 'string' && data.columns[col.idx].search.value == '' && filter != '' |
583 |
}) |
584 |
.map(function(col) { |
585 |
var part = {}; |
586 |
value = filter; |
587 |
part[!col.data.includes('.')?'me.'+col.data:col.data] = options.criteria === 'exact'?value:{like: (['contains', 'ends_with'].indexOf(options.criteria) !== -1?'%':'')+value+(['contains', 'starts_with'].indexOf(options.criteria) !== -1?'%':'')}; |
588 |
return part; |
589 |
}); |
590 |
|
591 |
query_parameters = and_query_parameters; |
592 |
query_parameters.push(or_query_parameters); |
578 |
if(query_parameters.length) { |
593 |
if(query_parameters.length) { |
579 |
query_parameters = JSON.stringify(query_parameters.length === 1?query_parameters[0]:query_parameters); |
594 |
query_parameters = JSON.stringify(query_parameters.length === 1?query_parameters[0]:{"-and": query_parameters}); |
580 |
if(options.header_filter) { |
595 |
if(options.header_filter) { |
581 |
options.query_parameters = query_parameters; |
596 |
options.query_parameters = query_parameters; |
582 |
} else { |
597 |
} else { |
583 |
- |
|
|