1. #1
    Sencha User
    Join Date
    Aug 2010
    Posts
    21
    Vote Rating
    0
    adana325 is on a distinguished road

      0  

    Exclamation form select field with images as values rather than text?

    form select field with images as values rather than text?


    I have a selectfield that I'd like to populate with images (one star, two stars, three stars) rather than text.

    I tried putting an image in where the text goes in an option array..like so.

    {
    xtype: 'selectfield',
    name : 'priority',
    label: 'Priority',
    options: [
    {text: '<img src="myimage.png">', value: 'high'},
    {text: 'Medium', value: 'medium'},
    {text: 'Low', value: 'low'}
    ]
    },

    The image resolves in the overlay to select the options..but when one is selected I get the label on my form an then the html for the image..so...

    priority: <img src="myimage.png">.

    I tried using html: instead of text: in my option array which isn't documented anywhere..and just got a blank field.

    has anyone managed to do this?

    thanks!
    adana

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,714
    Vote Rating
    438
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Currently you cannot do that. You will have to creat your own instance and do some fun stuff. I did something like this only with a div and a Picker for my ColorPickerField.

    Git here https://github.com/mitchellsimoens/E...lorPickerField
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Aug 2010
    Posts
    21
    Vote Rating
    0
    adana325 is on a distinguished road

      0  

    Default


    ok..thanks for the lead!

  4. #4
    Sencha Premium Member
    Join Date
    May 2012
    Posts
    1
    Vote Rating
    0
    loclab is on a distinguished road

      0  

    Default is there a way now?

    is there a way now?


    Any development to add image in Ext.selectField in sencha touch2 ?

Similar Threads

  1. Addition of images in a form text field
    By madhusudhan in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 16 Jan 2011, 9:31 PM
  2. How to insert blank spaces before text in select field of a form (Touch 0.96)
    By chaitu45 in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 12 Oct 2010, 10:41 AM
  3. How to get 'text' attribute from a 'select' form field
    By ssdesign in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 12 Aug 2010, 7:37 PM
  4. do not select existing text in text field when focus via tab key
    By mjlecomte in forum Ext 2.x: Help & Discussion
    Replies: 2
    Last Post: 13 Jul 2008, 6:23 PM
  5. FF can't select text in form text field
    By zonereseau in forum Ext 2.x: Help & Discussion
    Replies: 8
    Last Post: 11 Apr 2008, 10:54 AM