IE error when registering icons via resource manager

  1. #1

    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
    <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}\'>&nbsp;&nbsp;&nbsp;&nbsp;</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.
  2. #2
    Hi,

    It is fixed already. Until next public release you have to register all icons during initial page load (do not register during direct event)
    protected void Page_Load(object sender, EventArgs e)
    {
         if(!X.IsAjaxRequest)
         {     
              this.resourceManagerProxy.RegisterIcon(Icon.FlagGreen);
              this.resourceManagerProxy.RegisterIcon(Icon.FlagYellow);
              this.resourceManagerProxy.RegisterIcon(Icon.FlagRed);
        }
    }
  3. #3
    This does not break the application, but it does not make my icons appear either :(
  4. #4
    Hi,

    I did not notice that you use ResourceManagerProxy, please use real manager
    ResourceManager.GetInstance(this.Page)
  5. #5
    that worked, thank you

Similar Threads

  1. [CLOSED] resource manager and limiting extjs file size
    By craig2005 in forum 1.x Legacy Premium Help
    Replies: 9
    Last Post: Oct 03, 2013, 9:41 AM
  2. [CLOSED] What is the Resource Manager and how do I use it?
    By jwf in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 29, 2011, 6:46 PM
  3. [CLOSED] de-register or override the resource manager from master page
    By leon_tang in forum 1.x Legacy Premium Help
    Replies: 4
    Last Post: Aug 22, 2011, 2:48 PM
  4. Script Manager and Resource Manager Conflict
    By EugeneNiemand in forum 1.x Help
    Replies: 6
    Last Post: Jun 20, 2011, 7:34 AM
  5. Replies: 5
    Last Post: Oct 26, 2010, 2:20 PM

Posting Permissions