Feb 26, 2009, 8:04 AM
[CLOSED] Changing StyleSpec of Label
In my page, I have the following label control:
<ext:Label ID="lblTest" StyleSpec="background-color:rgb(255,255,0)" runat="server" />
If I then want to change the label's background colour server-side via a GridPanel RowSelect AjaxEvent, I attempt to do the following:lblTest.StyleSpec = "background-color:rgb(255,255,100)";
lblTest.Text = "Sample text";
The "Sample text" is inserted in to the label, however the label's colour doesn't change - why is this? The code returned to the page is the following, so the "styleSpec" code is rendering, but just doesn't appear to run:{script:"lblTest.styleSpec=\"background-color:rgb(255,255,100)\";lblTest.setText(\"Sample text\",true);"}