Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    55
    Vote Rating
    0
    bunty is on a distinguished road

      0  

    Default Answered: alerting for required field on screen load

    Answered: alerting for required field on screen load


    Hi all,

    I have a combobox with allowBlank set to false. When the screen loads, by default the combobox does not have red color border. I want to make it red on screen load itself. Any ideas on this?

    Code:
    Ext.define('GradeCombo', {    extend: 'Ext.form.field.ComboBox',
        alias: 'widget.gradecombo',
        allowBlank: false,
        blankText: 'Grade is required',
        queryMode: 'local',
        valueField: 'id',
        displayField: 'name',    
    });

  2. Try this:
    Code:
    Ext.define('GradeCombo', {    
        extend: 'Ext.form.field.ComboBox',
        alias: 'widget.gradecombo',
        allowBlank: false,
        blankText: 'Grade is required',
        queryMode: 'local',
        valueField: 'id',
        displayField: 'name',
        listeners: {
            render: function(){
                this.validate();
            }
        }
    });

  3. #2
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    346
    Vote Rating
    113
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      1  

    Default


    Try this:
    Code:
    Ext.define('GradeCombo', {    
        extend: 'Ext.form.field.ComboBox',
        alias: 'widget.gradecombo',
        allowBlank: false,
        blankText: 'Grade is required',
        queryMode: 'local',
        valueField: 'id',
        displayField: 'name',
        listeners: {
            render: function(){
                this.validate();
            }
        }
    });

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    55
    Vote Rating
    0
    bunty is on a distinguished road

      0  

    Default


    Thanks, that worked.

    For some other combobox present in the screen, I want the first displayField text to be displayed in the combobox textfield when the screen loads for the first time. How to achieve that?

  5. #4
    Sencha User
    Join Date
    Dec 2009
    Location
    Enschede, The Netherlands
    Posts
    327
    Answers
    16
    Vote Rating
    13
    flanders will become famous soon enough

      0  

    Default


    It would be better to open a new thread for a new question, IMHO. Especially if the original question might provoke more reactions, things might get quite cluttered.

    How about this reasoning:
    - On loading of the store,
    - I want to fetch the first record
    - And set it as my value.

    Translating that to code:


    Code:
    Ext.define('GradeCombo', {    
        extend: 'Ext.form.field.ComboBox',
        alias: 'widget.gradecombo',
        allowBlank: false,
        blankText: 'Grade is required',
        queryMode: 'local',
        valueField: 'id',
        displayField: 'name',
        listeners: {
            load: function(){
                this.setValue(this.store.getAt(0));
            }
        }
    });

  6. #5
    Sencha User
    Join Date
    Jan 2008
    Location
    Levittown, PA
    Posts
    316
    Answers
    2
    Vote Rating
    2
    mjhaston is on a distinguished road

      0  

    Default


    I have the opposite problem. All of my combobox seem to default to being marked with an error (with required field) as the message. This is when the form is first rendered before anyone types a thing. I'd like these combobox to perform like the textfields and datefields on the screen where they are marked as required when I tab through them and don't enter anything.

    Strange (to me at least) ... if I click my button to form.reset() the red required messages go away. That makes me think something is going on before or when my form is rendered to try and validate it!

Thread Participants: 3

Tags for this Thread