Text in imageSource

J. Landman Gay jacque at hyperactivesw.com
Wed Jan 25 21:14:28 EST 2006


Sarah Reichelt wrote:

> The second method produces a column that can be sorted, but setting
> the html directly does not. Checking the htmlText for each method,
> they appear to be identical.
> 
> It's as if Rev is storing the original character somewhere hidden and
> it doesn't appear in the htmlText although it is available to the sort
> command.

I'm pretty sure that's what it's doing. The character has to be stored 
somewhere, because if you remove the imagesource, the original character 
comes back.

> 
> I've tried setting the "alt" of the img but that doesn't help.
> 
> I have to use the direct HTML method for the initial display as
> setting the imageSource of each line on the field takes far too long,
> but it has to be sortable. Does anyone have any ideas?

Custom sort functions are made for this stuff. I'd test for the column 
the user wants to sort on, and sort normally unless it is the ratings 
column. In that case, use a custom function:

sort lines of fld <dataFld> by customSort(each)

function customSort pRatingHTML
   put 0 into tSkip
   put 0 into tNum
   repeat
     put offset("star",pRatingHTML,tSkip) into tOffset
     if tOffset = 0 then exit repeat
     add 1 to tNum
     add tOffset to tSkip
   end repeat
   return tNum
end customSort


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list