code: function() {
              if (this.hideClearButtonWhenEmpty && Ext.isEmpty(this.textField.getValue())) {
                  return false;
              }
  
              var clearButtonEl = this.clearButtonEl;
              //noinspection RedundantIfStatementJS
              if (this.hideClearButtonWhenMouseOut
                  && !clearButtonEl.hasCls(this.clearButtonCls + '-mouse-over-button')
                  && !clearButtonEl.hasCls(this.clearButtonCls + '-mouse-over-input')) {
                  return false;
              }
  
              return true;
          }
docs: Checks config options and current mouse status to determine if the clear button should be visible.