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'); }); } }
Comments
Post a Comment