Skip to Content
author's profile photo Former Member
Former Member

adding Icons to the IconPool

Hi,

Does someone has tried to add an icon to the IconPool of SAP UI5?

sap.ui.core.IconPool.addIcon(iconName, collectionName, iconInfo)

I'm asking about where do you have to put the actual icon.

It says that the iconInfo.fontFamily propertie is the name of the font when importing it using @font-face in the CSS, where do I have to allocate that fontFamily in my project directory?

As an example:

sap.ui.core.IconPool.addIcon("test","c-test", { fontFamily: "test-icon", content: "t001" })


The oIcon created has as URI property:

  1. uri: "sap-icon://c-test/test"

  2. But where is that location? Must I created an c-test collection in the .eot/.ttf files in the resources/sap/ui/core/themes/base/fonts directory?


  3. Thanks

  4. Luis Alberto


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    Posted on Jan 08, 2014 at 04:25 PM

    Hi Luis,

    Before addIcon, you have to do below one. There you have to declare icons.

    jQuery.sap.require("sap.ui.core.IconPool");

    var aNames = sap.ui.core.IconPool.getIconNames();

    And the src of Icon will be..

    sap.ui.core.IconPool.getIconURI(aNames[index]),

    Regards,

    Surendra.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.