1. #1
    Sencha Premium Member
    Join Date
    Aug 2011
    Posts
    3
    Vote Rating
    0
    NealHaggard is on a distinguished road

      0  

    Default Unanswered: Showing Currency in a Form

    Unanswered: Showing Currency in a Form


    I'm trying to display the currency that a number field is in somewhere in my field. It can be before the textfield, after the label, or even in the textfield (but I know that breaks the HTML5 number field, so that's fine).

    How would I go about either putting the currency symbol before the textfield or at the end of the label?

    Code:
    fields = {
                    xtype: 'fieldset',
                    items: [
                       {
                               name : 'amount',
          label: 'Amount',
          xtype: 'numberfield',
                                labelAlign: 'left',
                                labelWidth: '40%',
          required: false
       }
                 ]
    };
    My model looks like this:

    Code:
    amountModel = Ext.regModel("app.models.Amount", {
           fields: [
          {name: "amount", type: "int"},
          {name: "currencySymbol", type: "string"}
       ]
    };
    How do I either refer to the model's currencySymbol in the Label, or somehow display it to the left of the textfield?

  2. #2
    Touch Premium Member
    Join Date
    Mar 2011
    Location
    New Jersey, USA
    Posts
    130
    Answers
    4
    Vote Rating
    0
    jjerome is on a distinguished road

      0  

    Default


    if you create your form after your currency store is loaded, you can retrieve the currencySymbol and add it to the label. for example:

    Code:
    load: function(store, array)){
         symbol = array[0].data.currencySymbol;  //get the symbol
    
         ... //code setting up formPanel and other goodies
    
        //and you can use this like:   label: 'Amount' + symbol,
    
         ... //rest of the code
    }
    I wouldn't advise putting the symbol in the textfield, though.

  3. #3
    Sencha Premium Member
    Join Date
    Aug 2011
    Posts
    3
    Vote Rating
    0
    NealHaggard is on a distinguished road

      0  

    Default


    Thanks for the speedy reply, I'll give that a try!

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi