extjs4.1 - Extjs 4.1 - Looking for a event inside a combo That listen the Form reset -


i have window include combo like

       items: {             xtype: 'form',             items: {                 xtype: 'combo',                 id: 'combo',                 querymode: 'local',                                 displayfield: 'name',                 valuefield: 'id',                 store: ext.create('ext.data.store', {                     fields: ['id', 'name'],                     data: [                       {'id': '1', 'name': 'john smith'},                       {'id': '2', 'name': 'albert einstein'}                     ]                 }),                 listeners: {                     change: function( combo, newvalue, oldvalue, eopts ) {                         alert('reset fire 1');                     },                     dirtychange:function( combo, isdirty, eopts ) {                         alert('reset fire 2');                     },                    select: function( combo, records, eopts ) {                         alert('reset fire 3');                    }                 }             }         } 

i'm looking event inside combo when call reset form fire. possible? here code http://jsfiddle.net/kvrz7/

"change" event not bad:

listeners: {    change: function(field, val) {        if(!val) {            alert('reset');        }    } } 

see: http://jsfiddle.net/kvrz7/2/

another solution - can fire "reset" event in form (or field). in button:

handler: function() {     window.down('form').getform().reset();     window.down('form').fireevent('reset'); //<--------- firing event } 

and in combo:

listeners: {     afterrender: function(f) {         f.up('form').on('reset', function() {//<----- getting form , attach handler             alert('reset');         });     } } 

see: http://jsfiddle.net/kvrz7/4/


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -