ExtJS 4: Wie kann ich Neu Rendern Ext.Komponente iframe?

Wie kann ich wieder machen das Ext.Komponente, wenn ein combo-box-option ausgewählt ist?

var searchForm = Ext.create('Ext.form.Panel', {
    width: 320,
    style: 'margin: 20px',
    renderTo: 'SearchPanel',
    style: {
        position: 'fixed',
        top: '0px',
        left: '865px'
    },
    items: [{
        xtype: 'combo',
        width: 300,
        labelAlign: 'right',
        fieldLabel: 'Subject Area',
        store: subjectAreaStore,
        valueField: 'id',
        displayField: 'value',
        typeAhead: true,
        mode: 'local',
        triggerAction: 'all',
        selectOnFocus: true,
        value: 'Account',

        listeners: {
            select: function (combo) {
                cmp.autoEl.src = '/' + combo.getValue() + '/2nd Iteration.htm';
                alert(cmp.autoEl.src);

                cmp.render();  //this does not work!
            }
        }  //listeners
    }]

});               


//create the cmp
var cmp = Ext.create('Ext.Component', {

    title: 'Data Models',
    style: {
        width: '100%',
        height: '750px'
    },

    autoEl : {
        tag : 'iframe',
        src : '/Account/2nd Iteration.htm'
    },

    renderTo: 'models'
});

Update: 10/23/2012:

Dieser noch nicht läuft:

            listeners: {
                select: function (combo) {
                    cmp.autoEl.src = '/' + combo.getValue() + '/2nd Iteration.htm';
                    var the_iframe = cmp.getEl().dom;
                    the_iframe.contentWindow.location.reload();
                }
            }  //listeners
Irgendwelche Javascript-Fehler?
Sie sollten versuchen, mit den Ext.ux.IFrame-Erweiterung anstelle einer Komponente. Überprüfen Sie die neuesten docs unter "ux" und fügen Sie die Datei zu Ihrem Projekt.
Ich werde versuchen, es morgen, wenn ich zur Arbeit

InformationsquelleAutor MacGyver | 2012-10-23

Schreibe einen Kommentar