IE 7 but probably all IE:
When a SuperBoxSelect is drawn on a tab, the first onResize fails because the w isNaN .. Here is my modified code.
Code:
onResize : function(w, h, rw, rh) {
var reduce = Ext.isIE6 ? 4 : Ext.isIE7 ? 1 : Ext.isIE8 ? 1 : 0;
if (isNaN(w)) {
//Control not rendered
} else {
this._width = w;
if (this.outerWrapEl) {
this.outerWrapEl.setWidth(w - reduce);
if (this.renderFieldBtns) {
reduce += (this.buttonWrap.getWidth() + 20);
this.wrapEl.setWidth(w - reduce);
}
Ext.ux.form.SuperBoxSelect.superclass.onResize.call(this, w, h, rw, rh);
this.autoSize();
}
}
},
On BasicForm.Load, if the store is not populated, setValue blows out the store value. I decided to use the allowAddNewData functionality so that the control at least doesn't delete the value until the store does get populated.
Code:
setValue: function(value){
var values = value.split(this.valueDelimiter);
this.removeAllItems().resetStore();
Ext.each(values,function(val){
var record = this.findRecord(this.valueField, val);
if(record){
this.addRecord(record);
} else if (this.allowAddNewData) {
var item = new Object;
item[this.valueField] = val;
item[this.displayField] = val;
this.addItem(item);
}
},this);
},
The most severe problem is that when doing a load, I loose the ability to open the drop down via the drop button BUT the down arrow still works and the hold left click near the last item will also bring the list down as long as the left mouse button is clicked.
From tracing, it seems that it goes into the function twice and self closes. I'm stuck on that one.
[edit]
Figured out my last issue ..
Code:
this.buttonExpand.addClassOnOver('x-superboxselect-btn-over').on('click', function(e) {
e.stopEvent();
if (this.disabled) {
return;
}
if (this.isExpanded()) {
return;
//this.multiSelectMode = false;
} else if (this.pinList) {
this.multiSelectMode = true;
}
this.onTriggerClick();
}, this);
It seems that the the click event was being called multiple times - so the first click would show the drop down and then the second click would close it. The reason it worked on the demo was the click was being called 3 times, so it was remaining open.
Test code .. yeah .. its so nested in my little application, but here is me loading the SuperBoxSelect after a BasicForm.Load
Code:
var cmb = Ext.getCmp('cmb_Skill');
if (cmb) { if (JSON.Skill) { var JSONrec = JSON.Skill; if (cmb) cmb.store.loadRecords(cmb.store.reader.readRecords(JSONrec),false); } cmb.setDisabled(!JSON.Skill); if (clearValues) cmb.reset(); else {
var cmbV = cmb.getValue();
cmb.lastSelectionText = cmbV;
if(cmb.hiddenField){
cmb.hiddenField.value = cmbV;
}
cmb.setValue( cmbV );
}}
My SuperBoxSelect ..
Code:
{xtype:'superboxselect', id:'cmb_Skill', name:'cmb_Skill', hiddenName:'Skill', fieldLabel:'Skill', allowBlank:false,mode:'local',displayField:'Skillname' ,valueField:'Skillvalue',store: new Ext.data.SimpleStore({fields:['Linkvalue','Skillvalue','Skillname'], data:MyArea.BLANK}) , lastQuery:''}