Results 1 to 3 of 3

Thread: How to give relative path of a image in background css Ext.util.CSS.createStyleSheet

  1. #1
    Sencha Premium User
    Join Date
    Feb 2015
    Posts
    60
    Answers
    2

    Default Answered: How to give relative path of a image in background css Ext.util.CSS.createStyleSheet

    I am trying to set background image for a button using Ext.util.CSS.createStyleSheet . Below is the code snippet, i am writing this in a controller landingpage.js,but the background image is not getting called in background, I used same path for setting a image in a cell grid through same controller which is working fine;

    Ext.util.CSS.createStyleSheet('.filter1{background:#BFC9D2 !important;background-image:"/app/researchInvestments/images/close-icon.bmp";}');

    My Folder structure is as below
    Code:
    app
      -researchInvestments
                    --common
                                 ---controller
                                            ----landingpage.js
                                 ---model
                                 ---view
                                 ---store
                     --images
                                -----close-icon.bmp

  2. Thanks for the help, I used "setIcon()" method to set the Background icon to the Button

  3. #2
    Sencha User jdkhamba's Avatar
    Join Date
    Jul 2012
    Posts
    236
    Answers
    45

    Default

    Never a good idea to mix content display and content presentation. It is better to use css files instead of dynaically injection <style> tags in the DOM

    Just use the iconCls config of a button to set the background image and the actual path should be set in a css class.

  4. #3
    Sencha Premium User
    Join Date
    Feb 2015
    Posts
    60
    Answers
    2

    Default

    Thanks for the help, I used "setIcon()" method to set the Background icon to the Button

Similar Threads

  1. Cmd relative path issue
    By qooleot in forum Sencha Cmd
    Replies: 3
    Last Post: 19 Apr 2015, 4:21 AM
  2. Can't use relative path for frameworkOverride
    By JasonMO in forum Sencha Architect 3.x: Bugs
    Replies: 3
    Last Post: 9 Jan 2015, 6:26 AM
  3. Ext.util.CSS.createStyleSheet fails in IE11.
    By karlsnyder0 in forum Ext:Bugs
    Replies: 4
    Last Post: 17 Feb 2014, 2:34 PM
  4. Replies: 5
    Last Post: 2 Dec 2012, 6:55 PM
  5. [2.3.0] IE Bug in Ext.util.CSS.createStyleSheet
    By Baris in forum Ext 2.x: Bugs
    Replies: 8
    Last Post: 6 Aug 2009, 6:08 AM

Posting Permissions

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