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
    Aug 2012
    Posts
    23
    Vote Rating
    0
    Lampei is on a distinguished road

      0  

    Default Referring to items in a view

    Referring to items in a view


    Is there a preferred way to refer to other items within a view?

    In the code below, I'm trying to refer to the text area after the "Save" button is pressed in my onBtnAddNoteTap, so I can fire off an event with the value of the text area, rather than having a direct reference to the text area in my controller.

    Code:
    Ext.define('MyApp.view.AddNoteView', {    extend: 'Ext.form.Panel',
    
    
        config: {
            items: [
                {
                    xtype: 'textareafield',
                    id: 'txtAddNote',
                    itemId: 'txtAddNote',
                    padding: '0 0 20 0',
                    label: 'Note'
                },
                {
                    xtype: 'button',
                    itemId: 'btnAddNote',
                    text: 'Save'
                }
            ],
            listeners: [
                {
                    fn: 'onBtnAddNoteTap',
                    event: 'tap',
                    delegate: '#btnAddNote'
                }
            ]
        },
    
    
        onBtnAddNoteTap: function(button, e, options) {
            this.fireEvent('btnAddNotePressed');
            console.log(this.txtAddNote,'button - getTxtAddNote');
        }
    
    
    });

  2. #2
    Sencha User
    Join Date
    Aug 2012
    Posts
    23
    Vote Rating
    0
    Lampei is on a distinguished road

      0  

    Default


    And to expand on this slightly...I added a keyup listener on my textfield to try setting the values and then getting the values right after, and nothing is set and getValues() returns an empty object. I'm just not sure what I'm doing wrong here.

    Code:
    onTxtAddNoteKeyup: function(textfield, e, options) {        this.setValues({note:textfield.getValue()});
            console.log(this.getValues());
            console.log(this.value);
        }

  3. #3
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    71
    Vote Rating
    6
    cyee is on a distinguished road

      1  

    Default


    Ext.ComponentQuery.query('#txtAddNote')

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    23
    Vote Rating
    0
    Lampei is on a distinguished road

      0  

    Default


    Excellent! Thanks.

    Now does anyone know if there's a reason that this.getValues() is not working. "this" definitely seems to be referring to the "Ext.form.Panel". The method is there. Just keeps returning an empty object. I even set the values and then try to get the values right after, but still an empty object.

  5. #5
    Sencha Premium Member
    Join Date
    May 2011
    Posts
    71
    Vote Rating
    6
    cyee is on a distinguished road

      1  

    Default


    You should post your code you're using to set the values. My guess is that since the items in your form panel don't have a "name" parameter, the setValues() call doesn't know what to do with the data you're passing in to it.

  6. #6
    Sencha User
    Join Date
    Aug 2012
    Posts
    23
    Vote Rating
    0
    Lampei is on a distinguished road

      0  

    Default


    That was exactly it. Thanks again. I skipped right over the "name" part in the documentation. I thought I would just be able to set a struct for the panel, then get that struct back out again. Guess I need to dive into the Sencha code a little more.

Thread Participants: 1