ExtJS drop-down box to listen to events, date picker to listen to events, add dynamic data to delete items

1, drop-down box

  When the drop-down box to select the method of trigger events:

  In Ext.form.ComboBox new assembly listeners listen for events

  Wording is substantially : the Listeners { ' event ', function () { treatment } }

 

  listeners:{

    select:{

      fn:function(combo,record,index) {

      }

    }

  }

   

 

2, date picker

  When selecting a date, value changes and trigger this event before losing focus, that is, if the value of this component of the date change, and has not lost focus, this event will not be triggered. Solution:

  menuListeners: {

    select: function(m, d){

      this.setValue(d);

      alert((d - stringToDate(Ext.getCmp('endDate').value)) / (1000 * 60 * 60 * 24));

    },

    show : function(){ // retain focus styling 

    this.onFocus();

  },

  hide : function(){

    this.focus.defer(10, this);

    var ml = this.menuListeners;

    this.menu.un("select", ml.select,  this);

    this.menu.un("show", ml.show,  this);

    this.menu.un("hide", ml.hide,  this);

  }

   

3, the Items Dynamic Additions and Deletions

   

   

 

  When Depending on the query, the query conditions require different way, you need to select query in the drop-down box, listening to events triggered dynamically update items in the data

   

 

Guess you like

Origin www.cnblogs.com/damong/p/11994087.html