Results 1 to 4 of 4

Thread: How to use an icon as "value" of "displayfield"?

  1. #1

    Default How to use an icon as "value" of "displayfield"?

    I wish to have an icon displayed as "value" for a form "displayfield". This is to display read-only values like true/false and yes/no with icons like "tick mark/cross mark". How to do it? There are many posts on labels but that is not what I am looking for. I need a "fieldLabel" and then the icon (it is not mandatory to use a form though, I may use any component for this).

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,791
    Answers
    585

    Default

    See the source for displayfield.

    I think I'd try overriding getDisplayValue in a subclass. You should be able to generate whatever markup you need, then a bit of CSS and you're done.

  3. #3

    Default

    Finally did the following:


    { xtype: 'fieldcontainer', fieldLabel: 'Label 1', flex: 1, name: 'Name 1', items: [{ xtype: 'image', glyph: '[email protected]' }] },{ xtype: 'fieldcontainer', fieldLabel: 'Label 2', flex: 1, name: 'Name 2', items: [{ xtype: 'image', glyph: '[email protected]' }] }

  4. #4
    Sencha Premium User lumberjack's Avatar
    Join Date
    Nov 2014
    Location
    Kansas
    Posts
    781
    Answers
    102

    Default

    I think your approach is quite valid.

    Regards,
    Brian

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
  •