Lines 133-138
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
133 |
$.fn.api = function(options) { |
133 |
$.fn.api = function(options) { |
134 |
var settings = null; |
134 |
var settings = null; |
135 |
if(options) { |
135 |
if(options) { |
|
|
136 |
if(!options.criteria || ['contains', 'starts_with', 'ends_with', 'exact'].indexOf(options.criteria.toLowerCase()) === -1) options.criteria = 'contains'; |
137 |
options.criteria = options.criteria.toLowerCase(); |
136 |
settings = $.extend(true, {}, dataTablesDefaults, { |
138 |
settings = $.extend(true, {}, dataTablesDefaults, { |
137 |
'deferRender': true, |
139 |
'deferRender': true, |
138 |
"paging": true, |
140 |
"paging": true, |
Lines 177-183
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
177 |
}) |
179 |
}) |
178 |
.map(function(col) { |
180 |
.map(function(col) { |
179 |
var part = {}; |
181 |
var part = {}; |
180 |
part[!col.data.includes('.')?'me.'+col.data:col.data] = {like: (data.columns[col.idx].search.value != '' ? data.columns[col.idx].search.value : filter)+'%'}; |
182 |
var value = data.columns[col.idx].search.value != '' ? data.columns[col.idx].search.value : filter; |
|
|
183 |
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?'%':'')}; |
181 |
return part; |
184 |
return part; |
182 |
}); |
185 |
}); |
183 |
|
186 |
|
Lines 193-199
jQuery.fn.dataTable.ext.errMode = function(settings, note, message) {
Link Here
|
193 |
delete options.query_parameters; |
196 |
delete options.query_parameters; |
194 |
} |
197 |
} |
195 |
|
198 |
|
196 |
dataSet._match = 'starts_with'; |
199 |
dataSet._match = options.criteria; |
197 |
|
200 |
|
198 |
if(options.columns) { |
201 |
if(options.columns) { |
199 |
var order = data.order; |
202 |
var order = data.order; |
200 |
- |
|
|