Custom text_filter that ignores HTML

Hi, I’m having difficulty figuring out how to do a custom text_filter using the built in #text_filter header item.  I have a column which contains a hyperlink but I only want to filter on the textContent of the cell and not the value.  Meaning the cell = “My Title”  But when I type “s” into the text_filter the row doesn’t hide because “s” if found in the value.  I only want to show rows where the actual visable text contains the filter term.  How can I implement this?

I thought about implementing an extra hidden column and overriding the filterBy and really filter the text only column but that seems a bit unneccessary.  Is there a way I can do this with a customized filterBy or onFilterStart function?


If you not using srnd|paging mode - you can use custom version of link excell, it will work correctly with built-in filters ( only text part of link will be used for filtering )
dhtmlx.com/docs/products/kb/inde … k%20excell

In common case you can place a custom input in header and call grid.filterBy from some key event or use native #text_filter and onFitlerStart event as

grid.attachEvent(“onFilterStart”,function(ord,data){
//for simplicity , code below will change logic only of first text_filter in the grid
var origianal=data[0];
data[0]=function(value){
if (value.toString().replace(/<[^>]*>/,"").indexOf(original)!=-1) return true;
return false;
}
grid.filterBy(ord,data);
return false;
});

above code replace static value with filtering function, which will remove any tags from value , before checking

I went with the onFilterStart method and it worked perfect thanks!  …and significantly faster than the version I ended up working out.