src/jquery.dataTables.yadcf.js
//Used by exFilterColumn for translating readable search value into proper search string for datatables filtering
Used by exFilterColumn for translating readable search value into proper search string for datatables filtering
Used by exFilterColumn for translating readable search value into proper search string for datatables filtering
function yadcfMatchFilterString(table_arg, column_number, selected_value, filter_match_mode, multiple, exclude) {
			var case_insensitive = yadcf.getOptions(table_arg.selector)[column_number].case_insensitive,
				ret_val;
			if (!selected_value) {
				return '';
			}
			table_arg.fnSettings().aoPreSearchCols[column_number].bSmart = false;
			table_arg.fnSettings().aoPreSearchCols[column_number].bRegex = true;
			table_arg.fnSettings().aoPreSearchCols[column_number].bCaseInsensitive = case_insensitive;
			if (multiple === undefined || multiple === false) {
				if (exclude !== true) {
					if (filter_match_mode === "contains") {
						table_arg.fnSettings().aoPreSearchCols[column_number].bSmart = true;
						table_arg.fnSettings().aoPreSearchCols[column_number].bRegex = false;
						ret_val = selected_value;
					} else if (filter_match_mode === "exact") {
						ret_val = "^" + selected_value + "$";
					} else if (filter_match_mode === "startsWith") {
						ret_val = "^" + selected_value;
					} else if (filter_match_mode === "regex") {
						ret_val = selected_value;
					}
				} else {
					ret_val = "^((?!" + selected_value + ").)*$";
				}
			} else {
				if (filter_match_mode !== 'regex') {
					if (!(selected_value instanceof Array)) {
						selected_value = [selected_value];
					}
					selected_value = escapeRegExpInArray(selected_value);
				}
				if (filter_match_mode === "contains") {
					ret_val = selected_value.join("|");
				} else if (filter_match_mode === "exact") {
					ret_val = "^(" + selected_value.join("|") + ")$";
				} else if (filter_match_mode === "startsWith") {
					ret_val = "^(" + selected_value.join("|") + ")";
				} else if (filter_match_mode === "regex") {
					ret_val = selected_value;
				}
			}
			return ret_val;
		}
function yadcfMatchFilterString ( table_arg , column_number , selected_value , filter_match_mode , multiple , exclude ) { var case_insensitive = yadcf . getOptions ( table_arg . selector ) [ column_number ] . case_insensitive , ret_val ; if ( ! selected_value ) { return '' ; } table_arg . fnSettings ( ) . aoPreSearchCols [ column_number ] . bSmart = false ; table_arg . fnSettings ( ) . aoPreSearchCols [ column_number ] . bRegex = true ; table_arg . fnSettings ( ) . aoPreSearchCols [ column_number ] . bCaseInsensitive = case_insensitive ; if ( multiple === undefined || multiple === false ) { if ( exclude !== true ) { if ( filter_match_mode === "contains" ) { table_arg . fnSettings ( ) . aoPreSearchCols [ column_number ] . bSmart = true ; table_arg . fnSettings ( ) . aoPreSearchCols [ column_number ] . bRegex = false ; ret_val = selected_value ; } else if ( filter_match_mode === "exact" ) { ret_val = "^" + selected_value + "$" ; } else if ( filter_match_mode === "startsWith" ) { ret_val = "^" + selected_value ; } else if ( filter_match_mode === "regex" ) { ret_val = selected_value ; } } else { ret_val = "^((?!" + selected_value + ").)*$" ; } } else { if ( filter_match_mode !== 'regex' ) { if ( ! ( selected_value instanceof Array ) ) { selected_value = [ selected_value ] ; } selected_value = escapeRegExpInArray ( selected_value ) ; } if ( filter_match_mode === "contains" ) { ret_val = selected_value . join ( "|" ) ; } else if ( filter_match_mode === "exact" ) { ret_val = "^(" + selected_value . join ( "|" ) + ")$" ; } else if ( filter_match_mode === "startsWith" ) { ret_val = "^(" + selected_value . join ( "|" ) + ")" ; } else if ( filter_match_mode === "regex" ) { ret_val = selected_value ; } } return ret_val ; }
Used by exFilterColumn for translating readable search value into proper search string for datatables filtering
Used by exFilterColumn for translating readable search value into proper search string for datatables filtering