Skip to content

Commit

Permalink
bSmart is set to true in contains
Browse files Browse the repository at this point in the history
auto_complete filter can accept an object to use it later in its constructor (for examplefor external ajax source)

#148
#144
  • Loading branch information
vedmack committed Jan 30, 2015
1 parent 763f148 commit 50331dd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lab/jquery.dataTables.yadcf.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ var yadcf = (function ($) {

if (multiple === undefined || multiple === false) {
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") {
Expand All @@ -509,6 +510,7 @@ var yadcf = (function ($) {
}
} else {
if (filter_match_mode === "contains") {
table_arg.fnSettings().aoPreSearchCols[column_number].bSmart = true;
table_arg.fnSettings().aoPreSearchCols[column_number].bRegex = true;
ret_val = selected_value.join("|");
} else if (filter_match_mode === "exact") {
Expand All @@ -525,7 +527,7 @@ var yadcf = (function ($) {
function yadcfMatchFilter(oTable, selected_value, filter_match_mode, column_number) {
var case_insensitive = yadcf.getOptions(oTable.selector)[column_number].case_insensitive;
if (filter_match_mode === "contains") {
oTable.fnFilter(selected_value, column_number, false, false, true, case_insensitive);
oTable.fnFilter(selected_value, column_number, false, true, true, case_insensitive);
} else if (filter_match_mode === "exact") {
oTable.fnFilter("^" + selected_value + "$", column_number, true, false, true, case_insensitive);
} else if (filter_match_mode === "startsWith") {
Expand Down Expand Up @@ -653,7 +655,7 @@ var yadcf = (function ($) {
stringForSearch = stringForSearch.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
stringForSearch = stringForSearch.split('narutouzomaki').join('|');

This comment has been minimized.

Copy link
@MrCsabaToth

MrCsabaToth Jan 30, 2015

Contributor

What's this noruzoutomaki thingie there?

This comment has been minimized.

Copy link
@MrCsabaToth

MrCsabaToth Jan 30, 2015

Contributor

narutouzomaki

if (filter_match_mode === "contains") {
oTable.fnFilter(stringForSearch, column_number, true, false, true);
oTable.fnFilter(stringForSearch, column_number, true, true, true);
} else if (filter_match_mode === "exact") {
oTable.fnFilter("^(" + stringForSearch + ")$", column_number, true, false, true);
} else if (filter_match_mode === "startsWith") {
Expand Down

4 comments on commit 50331dd

@vedmack
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a second I was afraid that I had a typo :) but its on your side, oh wait, I do have a typo , its Uzumkai... anyway I had to think about some unique delimiter, so I used that one, Naruto Uzumaki

@MrCsabaToth
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha :) it's better if you have a typo then because yadcf could be used for an animal website ui too

@MrCsabaToth
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anime - without autocorrect

@vedmack
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, was scratching my head because of the "animal website" :)

Please sign in to comment.