I have the following requirements for a listgrid
1. Allow cell to be hyperlinked (with a custom click event)
2. Allow IMAGE to be displayed instead of CELL value if certain conditions are met
Both are easy if considered separately.
For #1, I used a custom CellFormatter and simply wrote out a hyperlink tag. It's important that I do this in the Cell Formatter as my hyperlink needs to know the CELL location (row, col) of the cell clicked (so I can add context sensitive information to the link).
For #2, I used a Hilite (to compare if condition is met) and the setHtmlValue field to replace the cell value with an image tag. I also support setHtmlBefore and setHtmlAfter if they want to show the image along with the value.
The problem comes when I try to do BOTH. I'm unable to produce a hyperlinked image.
I like the Hilite functionality because it handles condition assessment for me (i.e. does the field meet the criteria specified).
I allow my users to set a wide variety of conditions so simply coding the conditions into the CellFormatter is not a viable solution for me (I'd basically have to reimplement the entirety of your hilite functionality in the CellFormatter).
Question: Is there a handler that I can override that fires for a given cell when the hilite criteria has been met? That would allow me to AUGMENT the cell value rather than REPLACE it. I'm trying to find a way to CONDITIONALLY write an image into my hyperlink that I write in the CellFormatter.
I'm using SmartGWT 3.0 (Developer Console says
v8.2p_2013-07-11/Pro)
1. Allow cell to be hyperlinked (with a custom click event)
2. Allow IMAGE to be displayed instead of CELL value if certain conditions are met
Both are easy if considered separately.
For #1, I used a custom CellFormatter and simply wrote out a hyperlink tag. It's important that I do this in the Cell Formatter as my hyperlink needs to know the CELL location (row, col) of the cell clicked (so I can add context sensitive information to the link).
For #2, I used a Hilite (to compare if condition is met) and the setHtmlValue field to replace the cell value with an image tag. I also support setHtmlBefore and setHtmlAfter if they want to show the image along with the value.
The problem comes when I try to do BOTH. I'm unable to produce a hyperlinked image.
I like the Hilite functionality because it handles condition assessment for me (i.e. does the field meet the criteria specified).
I allow my users to set a wide variety of conditions so simply coding the conditions into the CellFormatter is not a viable solution for me (I'd basically have to reimplement the entirety of your hilite functionality in the CellFormatter).
Question: Is there a handler that I can override that fires for a given cell when the hilite criteria has been met? That would allow me to AUGMENT the cell value rather than REPLACE it. I'm trying to find a way to CONDITIONALLY write an image into my hyperlink that I write in the CellFormatter.
I'm using SmartGWT 3.0 (Developer Console says
v8.2p_2013-07-11/Pro)
Comment