PDA

View Full Version : How Combobox chain event



innosia
29 Nov 2011, 11:18 PM
I have a combobox, when the value change (select event) it will reload the store of other combobox, however the other combobox will always close by itself when you select the dropdown. This is certainly weird behavior of poor library created, I really wish i can use other product instead of ext js, however my boss decide to buy he because it is has relationship with your boss.

var store6 = Ext.create('CQT.store.trading.StockSymbol2', { autoLoad: false });
var store7 = Ext.create('CQT.store.trading.PriceList', { autoLoad: false });
var store8 = Ext.create('CQT.store.trading.QuantityList', { autoLoad: false });

........................
{
id: 'selectedSymbol',
name: 'selectedSymbol',
xtype: 'combo',
displayField:'Company_Code',
hidden: false,
mode: 'remote',
emptyText: '(Input Symbol Here)',
resizable: false,
forceSelection:true,
store: store6,
pageSize: 6,
autoLoad: false,
minChars: 1,
minListWidth: 320,
autoSelect: true,
enableKeyEvents: true,
loadingText: "wait...",
selectOnFocus: true,
width:120,
listeners: {
loadexception: {
fn: function (proxy, store, response, e) {
Ext.MessageBox.alert(alert_lbl, "Fail Loading Symbol ");
}, scope: this
},
select: function (combo, record, index) {
var val = record[0].get("Company_Code");
val = trim(val);
this.setRawValue(val);
formPanel.down('[name=txtSelectedSymbol]').setValue(val);
currencyCombo.setValue('');
txtPrice.setValue('');
txtQuantity.setValue('');
store7.load({ params : { cocode : val } });
store8.load({ params : { cocode : val } });
},
blur : function() {
var val = this.getRawValue();
val = trim(val);
this.setRawValue(val);
formPanel.down('[name=txtSelectedSymbol]').setValue(val);
CheckSymbol();
},
expand: function (combo) {
var input = this.getRawValue();
store6.removeAll();
store6.load({ params: { start: combo.getParams().start, limit: combo.getParams().limit, query: input} });
},
keyup: function (txt, e) {
var input = this.getRawValue();
KeywordRegex = new RegExp(input, "i");
},
keypress: {
buffer: 1,
fn: function () {
if (!this.getRawValue()) {
this.doQuery('', true);
}
}
}
}
}
........................

var txtPrice = Ext.create('Ext.form.field.ComboBox', {
id: 'txtPrice',
name: 'txtPrice',
xtype: 'combo',
valueField:'PriceList',
displayField:'PriceList',
hidden: false,
mode: 'remote',
emptyText: '(Input Price Here)',
resizable: false,
forceSelection:true,
store: store7,
autoLoad: false,
minChars: 1,
minListWidth: 320,
autoSelect: true,
enableKeyEvents: true,
loadingText: "wait...",
selectOnFocus: true,
width:100,
listeners: {
loadexception: {
fn: function (proxy, store, response, e) {
Ext.MessageBox.alert(alert_lbl, "Fail Loading Price");
}, scope: this
},
select: function (combo, record, index) {
var val = record[0].get("PriceList");
val = trim(val);
this.setRawValue(val);
},
blur : function() {
var val = this.getRawValue();
val = trim(val);
this.setRawValue(val);
},
expand: function (combo) {
var compcode = Ext.getCmp('selectedSymbol').getValue();
var input = this.getRawValue();
store7.load({ params: { cocode : compcode } });
}
}
});

Please help, and if you can't help please stop the development of your product and close your company, it is better to do that than making other developer life difficult.

tvanzoelen
30 Nov 2011, 12:33 AM
use code tags plz and some formating would be great..



var store6 = Ext.create('CQT.store.trading.StockSymbol2', { autoLoad: false });
var store7 = Ext.create('CQT.store.trading.PriceList', { autoLoad: false });
var store8 = Ext.create('CQT.store.trading.QuantityList', { autoLoad: false });

........................
{
id: 'selectedSymbol',
name: 'selectedSymbol',
xtype: 'combo',
displayField:'Company_Code',
hidden: false,
mode: 'remote',
emptyText: '(Input Symbol Here)',
resizable: false,
forceSelection:true,
store: store6,
pageSize: 6,
autoLoad: false,
minChars: 1,
minListWidth: 320,
autoSelect: true,
enableKeyEvents: true,
loadingText: "wait...",
selectOnFocus: true,
width:120,
listeners: {
loadexception: {
fn: function (proxy, store, response, e) {
Ext.MessageBox.alert(alert_lbl, "Fail Loading Symbol ");
}, scope: this
},
select: function (combo, record, index) {
var val = record[0].get("Company_Code");
val = trim(val);
this.setRawValue(val);
formPanel.down('[name=txtSelectedSymbol]').setValue(val);
currencyCombo.setValue('');
txtPrice.setValue('');
txtQuantity.setValue('');
store7.load({ params : { cocode : val } });
store8.load({ params : { cocode : val } });
},
blur : function() {
var val = this.getRawValue();
val = trim(val);
this.setRawValue(val);
formPanel.down('[name=txtSelectedSymbol]').setValue(val);
CheckSymbol();
},
expand: function (combo) {
var input = this.getRawValue();
store6.removeAll();
store6.load({ params: { start: combo.getParams().start, limit: combo.getParams().limit, query: input} });
},
keyup: function (txt, e) {
var input = this.getRawValue();
KeywordRegex = new RegExp(input, "i");
},
keypress: {
buffer: 1,
fn: function () {
if (!this.getRawValue()) {
this.doQuery('', true);
}
}
}
}
}
........................

var txtPrice = Ext.create('Ext.form.field.ComboBox', {
id: 'txtPrice',
name: 'txtPrice',
xtype: 'combo',
valueField:'PriceList',
displayField:'PriceList',
hidden: false,
mode: 'remote',
emptyText: '(Input Price Here)',
resizable: false,
forceSelection:true,
store: store7,
autoLoad: false,
minChars: 1,
minListWidth: 320,
autoSelect: true,
enableKeyEvents: true,
loadingText: "wait...",
selectOnFocus: true,
width:100,
listeners: {
loadexception: {
fn: function (proxy, store, response, e) {
Ext.MessageBox.alert(alert_lbl, "Fail Loading Price");
}, scope: this
},
select: function (combo, record, index) {
var val = record[0].get("PriceList");
val = trim(val);
this.setRawValue(val);
},
blur : function() {
var val = this.getRawValue();
val = trim(val);
this.setRawValue(val);
},
expand: function (combo) {
var compcode = Ext.getCmp('selectedSymbol').getValue();
var input = this.getRawValue();
store7.load({ params: { cocode : compcode } });
}
}
});




This is certainly weird behavior of poor library created, I really wish i can use other product instead of ext js, however my boss decide to buy he because it is has relationship with your boss.


And plz tell us what kind of relationship they have. :))

innosia
30 Nov 2011, 1:05 AM
Please answer my question before asking what relationship they have.
From the large amount of javascript libraries which is reliable, they choose ext js which is unreliable, buggy and worse of all, it has so many unanswered question in the forum, which the dev itself might not know the answer

tvanzoelen
30 Nov 2011, 1:05 AM
But can you tell hat you mean by this?



however the other combobox will always close by itself when you select the dropdown

innosia
30 Nov 2011, 7:19 PM
bump my thread up

tvanzoelen
30 Nov 2011, 11:58 PM
You can bump this thread up yourself by marking the best answer.