javascript - Selectfield listener fires on view initialize -


It is difficult to explain that I am doing my best, please ask for my clarity if my problem is unclear.

I am filling a selectfield with options from a shop, this form displays the details that the user has to get when he clicks on a row in my normal list view. It all works innocent.

To capture the data, I use the initial listener to capture the data, to pass the data relevant to my data, in my push () I use and populate some scenes in the description-view (title, form, etc.).

After making changes to the field, there is a change in the My Selection field to request an AJAX request. What happens is that my selection panel loads an option from a store first, and then is called the listener initiator

result in an AJAX request in each view view. Since my initial listener changes to choose another option as active, selectfield thinks that something has changed and the change listener has been triggered.

What is the best way to activate a selected option without triggering the change listener?

Choose the field with the change listener:

  xtype: 'selectfield', itemId: 'groundtype', displayField: 'ground_name', valueField : 'Listener: {Change: Function (Data) {// execute AJAX request on change}}  

Form panel (start of viewer) listener < / P>

  Audience: {initialize: function () {var value = this.config.record; If (value! = Null) {this.down ('# groundtype'). SetValue (value.groundtype); }}}  

Thanks in advance!

You can suspend the event in the field when setting the value by using:

  var field = this.down ('#typetypepe'); Field.suspendEvents (); Field.setValue (value.groundtype); Field.resumeEvents (true);  

Note, in order to abandon the queued events, you have to go through the true .


Comments