Sorting with html tags

When using html tags in a cell in a grid,


the sorting gets messed up. Could you strip the tags out before sorting?

While soring grid takes getValue() method of the cell and sort by it value. If you want soring work in case of custom html in the cell, you can implement custom sorting function and strip html manually or implement custom eXcell type.

I don’t have the pro version so I can’t test/use it. This is what I came up with:

function str_noHTML(a,b,order)
	if (order=="asc")
		return (a.replace(/<\/?[^>]+(>|$)/g,"").toLowerCase()>b.replace(/<\/?[^>]+(>|$)/g,"").toLowerCase()?1:-1);
		return (a.replace(/<\/?[^>]+(>|$)/g,"").toLowerCase()>b.replace(/<\/?[^>]+(>|$)/g,"").toLowerCase()?-1:1);

I think all types of sorting could take advantage of this. Making a cell bold () or another color () to show emphasis throws the sorting off.

Or just add to the standard types: str, str_noHTML, int, int_noHTML, etc.