dhtmlxGrid

Hello to all,

I am trying to set up a filter on a “link” column type, but it filters by all the attributes of the cell: Link Text (including HTML), the URL and the Target.

Sample data:
<![CDATA[ Thecorp, Inc^company.asp?id=12345^_blank ]]>

Filtering by one of the following values will always return that previous row :

  • “fon” because it’s part of the tag
  • "thi" because it’s in the class attribute of the tag
  • "com" or “id” or “23” because it’s in the URL
  • "blan" because it’s in the target
etc…  so the result is totally irrelevant.

How can I filter only on the Link Text and omit the HTML tags in it?

Thanking you in advance for whatever help you can provide me with,
Steve.

You can use custom filter function


grid.filterBy(0,function(val){
val = (val||"").split("^")[0].replace(/<[^>]*>/g,"")

if (val.indexOf(MASK)!=-1) return true;
return false;
});

Hi Support,

Thanks a lot for the script, much appreciated !
I’m having problems implementing it though :





What am I doing wrong ?

Thanks again for your time.
Steve.

Please check attached sample.


1218620524.zip (89.1 KB)