Results 1 to 2 of 2

Thread: setIconCls is not reflecting its CSS

  1. #1
    Sencha User
    Join Date
    Nov 2013
    Location
    Chennai
    Posts
    15
    Answers
    2

    Default Answered: setIconCls is not reflecting its CSS

    Hello Folks, I am dynamically setting an iconCls for a menu item on click. The problem is the menu item is set with the iconCls CSS but its not reflecting immediately. When i refresh it, the iconCls is set and reflecting as expected.

    Please suggest me some measures to solve the issue .

    I want the menu item to set and reflect the iconCls CSS on mouse click


    Thanks In advance!!

  2. This is more of an browser loading issue... your icon is not required by the browser until the menu is actually rendered, so the image is not available at that point. Possible solutions are: a) use a fontIcon, b) use the sprite pattern (shared with other parts of your app so it gets loaded) or c) explicitly load the image before the menu is rendered (i.e., in a hidden component that gets removed immediately)

  3. #2
    Sencha - Engineering israelroldan's Avatar
    Join Date
    Nov 2011
    Location
    The Netherlands
    Posts
    395
    Answers
    25

    Default

    This is more of an browser loading issue... your icon is not required by the browser until the menu is actually rendered, so the image is not available at that point. Possible solutions are: a) use a fontIcon, b) use the sprite pattern (shared with other parts of your app so it gets loaded) or c) explicitly load the image before the menu is rendered (i.e., in a hidden component that gets removed immediately)
    Israel Roldán | Senior Software Engineer (Framework tools)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •