Results 1 to 4 of 4

Thread: displaying a badge on arbitrary elements (non-components)

  1. #1
    Sencha User
    Join Date
    Dec 2011
    Posts
    72
    Vote Rating
    5
      0  

    Default displaying a badge on arbitrary elements (non-components)

    Hi all,

    I have seen the convenient way to set badge text on components using a setBadge method.

    I need a way to create a badge for non-components. Basically I have a DataView that creates an icon grid from store data. That works fine. But I want to be able to show a badge on some of those icons which are just dom elements. In looking at the generated source, I see that the dataview does not create actual ext components of each of the items, so doesn't seem like there is a setBadge method for me to call on a given item. I tried to do it manually, by setting the class 'x-badge' on one of my divs, but it didn't have any effect.

    Any help is appreciated.

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Vote Rating
    1381
      0  

    Default

    In your template, create a <div> that is positioned where you want it and with the text you want.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    72
    Vote Rating
    5
      0  

    Default

    Thanks for the reply. OK, so seems that I'll need to do it manually in the template; easy enough. Is there a css class that I can apply to the div so that it stays consistent in appearance with the badge added by setBadge?

  4. #4
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,050
    Vote Rating
    1381
      0  

    Default

    I would forget about the badge, most likely you will need to write your own CSS
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

Posting Permissions

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