The Ext. Form. ComboBox of the dynamic data source cannot set the initial value as the static data source does. The result will only make the set value directly on the interface.
You can use the following method to handle this problem:
For example, ter
VaR terminalmodelstore = new Ext. Data. jsonstore
({
Root: 'rows ',
Totalproperty: 'recordcount ',
URL: 'getterminalmodel. action ',
Fields: ['name', 'value'],
Autoload: True
})
VaR terminalmodel = new Ext. Form. ComboBox
({
ID: 'trmlmodel ',
Name: 'trmlmodel ',
Hiddenname: 'terminalmodel ',
Fieldlabel: 'terminal model ',
Typeahead: True,
// Emptytext: '-- select --',
// Disabled: True,
Mode: 'local ',
Triggeraction: 'all ',
Selectonfocus: True,
Forceselection: True,
Editable: false,
Valuefield: 'value ',
Displayfield: 'name ',
Anchor: '20140901 ',
// Value: 'all ',
Store: terminalmodelstore
});
Function initdata (){
Terminalmodel. setvalue ('all ');
Ext. Form. ComboBox. superclass. setvalue. Call (terminalmodel, 'all ');
}
Viewport. On ('aferrender', initdata ());
Another use of Ext. Form. ComboBox has plagued me a lot, that is, the value after the form is submitted.
The value of Ext. Form. ComboBox can only be obtained by the name defined by hiddenname.
For example:
Name: 'trmlmodel ',
Hiddenname: 'terminalmodel ',
Request. getparameter ("
Terminalmodel ") is the correct value,
Request. getparameter ("
Trmlmodel
") Actually get the name of the display, that is,"
Displayfield
.