EXTjs: How to display data automatically when droplist is selected

In ui file:


/* Staff droplist*/
    var comboFormStaff = new Ext.form.ComboBox({
        id: 'id-combo-staff',
        fieldLabel: 'Nama Ahli Lembaga(Staf)',
        name: 'frm_staff',
        typeAhead: false,
        triggerAction: 'all',
        emptyText: '-- Staf --',
        selectOnFocus: true,
        store: storeStaff,
        valueField: 'id',
        displayField: 'nama',
        value: '',
        width: 300,
        valueNotFoundText: ''
    })



comboFormStaff.on( 'select', function( combo, rec, idx ){
        Ext.getCmp( 'id-frm-no-kp' ).setValue( rec.data.no_kp );
    })

In model file:
* make sure the no_kp item was called in sql statement;

No comments: