Sep 21, 2010, 10:40 AM
IE error when registering icons via resource manager
Hi,
I am using gridpanel and my goal is to show column 'Priority' (that comes from int enum values - 1,2 or 3) as flags (without any text).
I chose three of them:
Icon.FlagGreen
Icon.FlagYellow
Icon.FlagRed
I did this following the instructions in this thead: http://forums.ext.net/showthread.php...-in-javaScript
Here is the code I use:
Excerpt from store that contains data for this column
The problem is:
After few (i can't deteremine how many is the number - 4, 5, sometimes 6) ajax requests (like for example clicking on grid column headers to sort grid) I get the following error from javascript:
By lpodolak at 2010-09-21
In a debug mode it results as shown on the screen. Without debugging, it raises javascript error window.
What is interesting is that it occurs only in IE - i checked that firefox doesn't show such problems
I also noticed, that application responds normally without registration code in Page_Load. However, without it, Icons don't show on my grid.
How can I get rid of this error?
thanks
Łukasz Podolak
I am using gridpanel and my goal is to show column 'Priority' (that comes from int enum values - 1,2 or 3) as flags (without any text).
I chose three of them:
Icon.FlagGreen
Icon.FlagYellow
Icon.FlagRed
I did this following the instructions in this thead: http://forums.ext.net/showthread.php...-in-javaScript
Here is the code I use:
Excerpt from store that contains data for this column
<ext:Store ID="dsTasks" runat="server" RemoteSort="true" RemotePaging="true" OnRefreshData="LoadTasks">
<Proxy>
<ext:PageProxy />
</Proxy>
<Reader>
<ext:JsonReader>
<Fields>
<ext:RecordField Name="Id" />
<ext:RecordField Name="Version" />
<ext:RecordField Name="Priority" />
<ext:RecordField Name="PriorityCaption" />
definition of this column in gridpanel<ext:GridPanel ID="grdTasks" runat="server" StoreID="dsTasks" AutoHeight="true" Border="false" AutoWidth="true" AutoExpandColumn="Subject">
<ColumnModel runat="server">
<Columns>
<ext:Column ColumnID="Priority" Header="Priorytet" DataIndex="Priority" Hidden="true" Width="40">
<Renderer Fn="preparePriorityColumn" />
</ext:Column>
...
javascript function to render content: var preparePriorityColumn = function (value, metadata, record, rowIndex, colIndex, store) {
var iconClass = 'icon-flagred';
if (record.data.Priority == 100)
iconClass = 'icon-flaggreen';
else if (record.data.Priority == 200)
iconClass = 'icon-flagyellow';
var priorityName = record.data.PriorityCaption;
return String.format('<span class=\'{0}\' title=\'{1}\'> </span> ', iconClass, priorityName);
}
and finally the part from codebehind to register icons (I have resourcemanagerproxy element on this control): public partial class TaskList : UserControlBase<ITaskService>
{
protected void Page_Load(object sender, EventArgs e)
{
this.resourceManagerProxy.RegisterIcon(Icon.FlagGreen);
this.resourceManagerProxy.RegisterIcon(Icon.FlagYellow);
this.resourceManagerProxy.RegisterIcon(Icon.FlagRed);
The problem is:
After few (i can't deteremine how many is the number - 4, 5, sometimes 6) ajax requests (like for example clicking on grid column headers to sort grid) I get the following error from javascript:
By lpodolak at 2010-09-21
In a debug mode it results as shown on the screen. Without debugging, it raises javascript error window.
What is interesting is that it occurs only in IE - i checked that firefox doesn't show such problems
I also noticed, that application responds normally without registration code in Page_Load. However, without it, Icons don't show on my grid.
How can I get rid of this error?
thanks
Łukasz Podolak
Last edited by lpodolak; Sep 21, 2010 at 11:20 AM.