Nov 26, 2008, 3:58 AM
[CLOSED] Mozilla provblem
hi,
i have set a cell background color gor gridpanel.The code is working fine in internet exploar and set the cell background color. And the problem is the code is working fine in mozilla browser but the cell background color is not set in gridpanel. i am using the rgb values for colors. please give a solution. urgent...
i have set a cell background color gor gridpanel.The code is working fine in internet exploar and set the cell background color. And the problem is the code is working fine in mozilla browser but the cell background color is not set in gridpanel. i am using the rgb values for colors. please give a solution. urgent...
<ext:Store ID="Store3" runat="server" >
<Reader>
<ext:ArrayReader> <Fields>
<ext:RecordField Name="COLOUMN1" />
<ext:RecordField Name="COLOUMN2" />
</Fields>
</ext:ArrayReader>
</Reader>
</ext:Store>
<ext:GridPanel ID="GridPanel3" runat="server" StoreID="Store3"
Height="150px" Width="500px" MonitorResize="false">
<ColumnModel ID="ColumnModel3" runat="server" >
<Columns>
<ext:Column DataIndex="COLOUMN1" Header="Colour" >
<Renderer Fn="COLOUMN1" />
</ext:Column>
<ext:Column DataIndex="COLOUMN2" Header="Pantone No" />
</Columns>
</ColumnModel>
</ext:GridPanel>
c# code:
this.Store3.DataSource = new object[]
{
new object[] {"32,32,32",488},
new object[] {"153,160,123",458}
};
this.Store1.DataBind();
<script type="text/javascript">
var template = '<div style="height:20px; margin:1px; padding:0px; width:100%; background-color:{0};">{1}
';
var COLOUMN1 = function(value)
{
var where_is_mytool=value;
var mytool_array=where_is_mytool.split(",");
return String.format(template,RGBtoHex(mytool_array[0],mytool_array[1],mytool_array[2]),value);
}
function RGBtoHex(R,G,B)
{
return toHex(R)+toHex(G)+toHex(B)
}
function toHex(N)
{
if (N==null) return "00";
N=parseInt(N); if (N==0 || isNaN(N)) return "00";
N=Math.max(0,N); N=Math.min(N,255); N=Math.round(N);
return "0123456789ABCDEF".charAt((N-N%16)/16)+ "0123456789ABCDEF".charAt(N%16);
}
</script>
</PRE>