Reputation: 106
I'm using YADCF plugin for datatables and I'm using exResetAllFilters to reset all column filters but it doesn't work.
I have done an example using Jsfiddle. Using Firebug I can see the error:
TypeError: string is undefined
return string.replace(new RegExp(escapeRegExp(find), 'g'), replace);
I have changed this function in the YADCF library and also generateTableSelectorJQFriendly to check if string is empty.
function replaceAll(string, find, replace) {
if (string) {
return string.replace(new RegExp(escapeRegExp(find), 'g'), replace);
}
else {
return string;
}
}
function generateTableSelectorJQFriendly(tmpStr) {
if (tmpStr) {
tmpStr = replaceAll(tmpStr, ".", "-");
tmpStr = replaceAll(tmpStr, ' ', '');
return tmpStr.replace(":", "-").replace("(", "").replace(")", "").replace("#", "-");
}
else {
return tmpStr
}
}
After these changes I see a different error
TypeError: table_arg.fnDraw is not a function
table_arg.fnDraw(settingsDt);
How can I fix it?
Upvotes: 0
Views: 863
Reputation: 37061
The issue in jsfiddle was just a jsfiddle issue related to its wrapping way,
I have solved it by using .click
instead of dom onclick (I did so only because its jsfiddle - in a normal web app you can use onclick without any problems) , see working jsfiddle, if you have any other issue that can be reproduced feel free to ask
Upvotes: 1