on 11-13-2006 5:35 PM
Hi sdn,
Below is a simple function returning an icon depending upon the cell value. But the switch statement never works. I pass the cell_value to the function as follows:
==========================================================
for (var rowno =1;rowno < obj.rows.length-1;rowno++) { obj.rows(rowno).cells(3).width = 50; obj.rows(rowno).cells(3).innerHTML = getIcon(obj.rows(rowno).cells(3).innerHTML); }
==========================================================
The troubling function is as follows:
==========================================================
function getIcon(Cell_Value){ var icon switch (Cell_Value){ case -2.000: icon= "" break; case -1.000: icon= "" break; case 0.000: icon= "" break; case 1.000: icon= "" break; case 2.000: icon= "" break; } return icon }
Can someone please tell me how do I make this comparison to replace value with an icon. I alway award points.
Thx.
Saf.
Hi Safdar,
I have never seen a Case statement assign icons. (But, maybe I have not looked in the right places.)
I would suggest assigning string Names to the icons. Use the Case statement to choose the one to use. Then assign the Named icon to the cell.
Hope this helps.
- Pete
P.S. Is this for WAD or Excel front end?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.