filtering problem
filtering problem
28.vivek.s
Posts: 69Questions: 0Answers: 0
hi Allan.
first of all thanks for such a great plug in.
i am using dataTable1.6.2
Actually i am using individual column functionality of dataTable and my code is
[code]oTable.fnFilter([container],iColumn,false);[/code]
where, as you know
container is input parameter(input string) and iColumn is column no on which i am apllying this filter function to filter the Table.its working fine for all input except if its like
Look & Feel
if i am giving input string like this, then table is not getting filtered.
i think its because of '&'.
so i tried to escape this but problem not get solved.
so please let me know if there is any solution for this or if Somewhere i am wrong
thanks in advance
vivek
first of all thanks for such a great plug in.
i am using dataTable1.6.2
Actually i am using individual column functionality of dataTable and my code is
[code]oTable.fnFilter([container],iColumn,false);[/code]
where, as you know
container is input parameter(input string) and iColumn is column no on which i am apllying this filter function to filter the Table.its working fine for all input except if its like
Look & Feel
if i am giving input string like this, then table is not getting filtered.
i think its because of '&'.
so i tried to escape this but problem not get solved.
so please let me know if there is any solution for this or if Somewhere i am wrong
thanks in advance
vivek
This discussion has been closed.
Replies
Allan
Thanks for reply.
No,its not but there is same value in table.
As you said this has been fixed,i searched a lot but i didn't get that discussion.
So if its possible can you post that discussion url.
I tried this with 1.7.0 but i got another problem i passed my input string in fallowing three conditions
1- only bSmart is enabled,i got the results as expected but when i passed multivalued input string, for exmp
Look & Feel|cosmos|program
its not getting filtered,output comes "No Match's found"
2-only bRegx is enabled,it gives result for multivalued string but not for input like"Look & Feel"
3-when both bRegx and bSmart enabled,i got result "No Match's found" if i passed input "Look & Feel" or "Look & Feel|cosmos|program"
but i got results for other type of inputs.
Sorry i can't post any example because i am in development phase of my projecet,but you can refer your example
http://datatables.net/beta/1.7/examples/api/regex.html
by changing second column value Firefox 1.0 to "Firefox 1.0 & Firefox 1.5" and tries this with all three condition as i stated before.
again sorry for your inconvenience but really i am stucked here.
please help me .
thanks in advance
Vivek
Allan
yes its worked.i simply coded like this
[code]
function submitData(str,iColumn)
{
jQuery("#"+str+" :checked").each(function() {
if(container.length==0){
container = "^"+jQuery(this).val().LTrim();
}
else{
container += "|" +"^"+jQuery(this).val().LTrim();
}
});
if(container.length>0){
oTable.fnFilter([container],iColumn,false);
}
else{
oTable.fnFilter('',iColumn,false);
}
container = ""
}
String.prototype.LTrim = function()
{
return this.replace(/(^\s*)/g, "").replace(/\&/g,'&a_m_p;');
}
[/code]
here i am checking that checkbox is checked r not if yes then just called LTrim to replace '&' by '&a_m_p;', and after that passing it to fnFilter as a input parameter.(remove _ while you are doing actual code)
Vivek