Display a grid column as an image but sort based on a number?
Is it possible to have a grid column display an image, but sort based on numeric data that's somehow hidden in the cell?
Suppose I have a column named 'count' which stores, well, the count of something. I don't want to display the actual count -- I want to display an exclamation point image if the count is greater than some threshold. If the count is less than this threshold, nothing should be displayed in the cell. However, when I sort based on this column, I *do* want to use the real count to order the rows.
I've tried stuffing the text inside a hidden <span> in the cell and using AW.Formats.HTML, but that doesn't work because then the sorting is string-based and not numeric. I've tried using AW.Formats.Number, but then I don't get any sorting at all (I assume because it's trying to interpret the cell content as a number when it's actually an <img> tag).
I've been able to stick an image into a cell based on the count (in which case the sort is essentially based on whether the image exists or not). I've been able to sort based on the count itself (if I store the count in the cell -- in which case I don't have the image). I haven't yet figured out how to tie the two of these together.
I think perhaps a custom AW.Format class that combined AW.Formats.HTML & AW.Formats.Number might do the trick, but if there's an easier way that didn't require patching the code I'd rather do that.
Any ideas?
Suppose I have a column named 'count' which stores, well, the count of something. I don't want to display the actual count -- I want to display an exclamation point image if the count is greater than some threshold. If the count is less than this threshold, nothing should be displayed in the cell. However, when I sort based on this column, I *do* want to use the real count to order the rows.
I've tried stuffing the text inside a hidden <span> in the cell and using AW.Formats.HTML, but that doesn't work because then the sorting is string-based and not numeric. I've tried using AW.Formats.Number, but then I don't get any sorting at all (I assume because it's trying to interpret the cell content as a number when it's actually an <img> tag).
I've been able to stick an image into a cell based on the count (in which case the sort is essentially based on whether the image exists or not). I've been able to sort based on the count itself (if I store the count in the cell -- in which case I don't have the image). I haven't yet figured out how to tie the two of these together.
I think perhaps a custom AW.Format class that combined AW.Formats.HTML & AW.Formats.Number might do the trick, but if there's an easier way that didn't require patching the code I'd rather do that.
Any ideas?
Trevor
May 19,