Ext.form.ComboBox dropdown trigger

The Ext.form.ComboBox is almost testing friendly. Not everyone can do what we did, but we could and it made testing sooo much easier (and human readable).

onRender: function(ct, position) {
  Ext.form.TriggerField.superclass.onRender.call(this, ct, position);
  this.wrap = this.el.wrap({cls: "x-form-field-wrap"});
  this.trigger = this.wrap.createChild(this.triggerConfig ||
    {id: this.id + '_trigger', tag: "img", src: Ext.BLANK_IMAGE_URL,
    cls: "x-form-trigger " + this.triggerClass});
  // rest is as in original

And also

initList: function() {
  var cls = 'x-combo-list';
  this.tpl = '
{' + this.displayField + '}
'; js.ib.ui.CWComboBox.superclass.initList.call(this); },

An alternative is to use CSS selectors, as described by CableDawg on ExtJS’ forum.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.