1. #11
    Sencha Premium Member sencha-dev2's Avatar
    Join Date
    Jun 2012
    Location
    France
    Posts
    59
    Answers
    2
    Vote Rating
    0
    sencha-dev2 is on a distinguished road

      0  

    Default


    Thanks again for your answers. What do you mean by locale ? I'm glad to know that my code's right, but it still doesn't work...

  2. #12
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,074
    Answers
    111
    Vote Rating
    94
    Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light Farish is a glorious beacon of light

      0  

    Default


    locale means a language file for displaying default messages/labels etc. in you local language.

  3. #13
    Sencha Premium Member sencha-dev2's Avatar
    Join Date
    Jun 2012
    Location
    France
    Posts
    59
    Answers
    2
    Vote Rating
    0
    sencha-dev2 is on a distinguished road

      0  

    Default


    I don't think I'm using this. But my date field is a component of a separate widget, that I call upon in differents views.

    Code:
    Ext.define('Infologis.view.Composants.FormulaireAdresse', {
        extend: 'Ext.form.FieldSet',
        name: 'coordonneesPostales',
        title: 'Coordonnees Postales',
        style: {backgroundColor: '#EFEFEF'},
        layout: 'vbox',
        padding: 5,
        alias: 'widget.formulaireAdresse',
        height: 250,
        
        initComponent: function() {
            var me = this;
            
            Ext.applyIf(me, {
                items: [
                    {
                        xtype: 'container',
                        style: {
                            backgroundImage: 'url(images/icons/AdressePostale.png)',
                            backgroundRepeat: 'no-repeat',
                            backgroundPosition: 'center top'
                        },
                        width: 80,
                        height: 20
                    },
                    {
                        xtype: 'container',
                        name: 'coordPostales',
                        layout: 'vbox',
                        items: [
                            {
                                xtype: 'fieldcontainer',
                                name: 'adresseStructure',
                                layout: 'hbox',
                                items: [
                                    {
                                        xtype: 'textfield',
                                        name: 'numeroVoie',
                                        emptyText: 'Num.',
                                        fieldLabel: 'Adresse ',
                                        enforceMaxLength: true,
                                        maxLength: "4",
                                        width: 160,
                                        labelWidth: 120,
                                        allowBlank: true
                                    },
                                    {
                                        xtype: 'combobox',
                                        name: 'idComplementNumeroRue',
                                        displayField: 'libelleCNR',
                                        valueField: 'idComplementNumeroRue',
                                        queryMode:'local',
                                        store: 'ComplementNumeroRue',
                                        emptyText: 'Bis, Ter...',
                                        hideTrigger: true,
                                        width: 40,
                                        allowBlank: true
                                    },
                                    {
                                        xtype: 'combobox',
                                        name: 'idTypeVoie',
                                        displayField: 'court',
                                        emptyText: 'Rue...',
                                        queryMode:'local',
                                        valueField: 'idTypeVoie',
                                        store: 'TypeVoie',
                                        hideTrigger: true,
                                        width: 40,
                                        allowBlank: true
                                    },
                                    {
                                        xtype: 'textfield',
                                        name: 'nomVoie',
                                        emptyText: 'Nom de la voie',
                                        allowBlank: true,
                                        width: 130
                                    }
                                ]
                            },
                            {
                                xtype: 'fieldcontainer',
                                name: 'complementAdresseStructure',
                                items: [
                                    {
                                        xtype: 'textfield',
                                        name: 'complementAdresse',
                                        fieldLabel: 'Complement ',
                                        emptyText: 'ZI, Lieu-dit...',
                                        allowBlank: true,
                                        labelWidth: 120,
                                        width: 379
                                    }
                                ]
                            },
                            {
                                xtype: 'fieldcontainer',
                                name: 'villeStructure',
                                layout: 'hbox',
                                items: [ 
                                   {
                                        xtype: 'textfield',
                                        name: 'codePostal',
                                        maxLength: "5",
                                        enforceMaxLength: true,
                                        fieldLabel: 'Code Postal / Ville ',
                                        labelWidth: 120,
                                        width: 180,
                                        allowBlank: true,
                                        emptyText: '36000'
                                    },
                                    {
                                        xtype: 'combobox',
                                        name: 'idCommune',
                                        queryMode: 'local',
                                        hideTrigger: true,
                                        minChars: 2,
                                        displayField: 'nomCommune',
                                        valueField: 'idCommune',
                                        store: 'Commune',
                                        allowBlank: false,
                                        emptyText: 'CHATEAUROUX',
                                        width: 196,
                                        listeners: {
                                            select: {
                                                fn: function(cbo, rec) {
                                                    var codeP = rec[0].data.codePostal;
                                                    cbo.up('fieldcontainer[name="villeStructure"]').down('textfield[name="codePostal"]').setValue(codeP);
                                                }
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                xtype: 'textfield',
                                name: 'cedex',
                                allowBlank: true,
                                labelWidth: 120,
                                width: 379,
                                fieldLabel: 'CEDEX ',
                                emptyText: 'Cedex + numero boite postale',
                                listeners: {
                                    blur: {
                                        fn: function(text) {
                                            if(text.value != '' && typeof(text.value) != 'undefined')
                                                text.setValue(text.value.toUpperCase());
                                        }
                                    }
                                }
                            },
                            {
                                xtype: 'textfield',
                                name: 'pointRemise',
                                allowBlank: true,
                                labelWidth: 120,
                                width: 379,
                                fieldLabel: 'Point de remise ',
                                emptyText: 'i.e. Appartement 25... '
                            },
                            {
                                xtype: 'textfield',
                                name: 'localisationConstruction',
                                allowBlank: true,
                                labelWidth: 120,
                                width: 379,
                                fieldLabel: 'Localisation de la construction ',
                                emptyText: 'i.e. Batiment C...'
                            },
                            {
                                xtype: 'datefield',
                                name: 'dateEffet',
                                fieldLabel: 'Date d\'effet ',
                                format: 'd/m/Y',
                                labelWidth: 120,
                                width: 379,
                                allowBlank: false
                            }
                        ]
                    },
                    {
                        xtype: 'hidden',
                        name: 'idAdresse'
                    }
                ]
            });
                    me.callParent(arguments);
        }
    });
    Here's the global code of the widget.
    Last edited by sencha-dev2; 13 Aug 2012 at 11:04 PM. Reason: code readability

  4. #14
    Sencha User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    536
    Answers
    61
    Vote Rating
    70
    Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough

      0  

    Default


    Does it have the correct format if you manually click a date in the component dropdown?

  5. #15
    Sencha Premium Member sencha-dev2's Avatar
    Join Date
    Jun 2012
    Location
    France
    Posts
    59
    Answers
    2
    Vote Rating
    0
    sencha-dev2 is on a distinguished road

      0  

    Default


    No, it displays it like dd/mm/yy only.

  6. #16
    Sencha User Tim Toady's Avatar
    Join Date
    Feb 2010
    Location
    Pennsylvania
    Posts
    536
    Answers
    61
    Vote Rating
    70
    Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough Tim Toady is a jewel in the rough

      0  

    Default


    It has to be overridden somewhere. I can take the exact code you posted and it works fine. Is there anywhere else you can think of the format might be changed?

  7. #17
    Sencha Premium Member sencha-dev2's Avatar
    Join Date
    Jun 2012
    Location
    France
    Posts
    59
    Answers
    2
    Vote Rating
    0
    sencha-dev2 is on a distinguished road

      0  

    Default


    I'm sorry, I am part of a team, and everyone else is in holiday now. But I didn't configure anything to override this...