In Extjs, there will always be some minor issues when using ComboBox. I cannot find out the reason for this problem for a long time. The following are some notes ..
1. After the ComboBox loads data, the value in the ComboBox cannot be correctly mapped to the ComboBox.
Cause: because the value of name is to be passed to the server and the hidden property hiddeName is used to pass the value, the name of hiddenName must be the same as that of name. If the id and name are set to the same, they cannot be correctly matched. Therefore, the comboBox id and name cannot be set the same
New Ext. form. ComboBox ({
Id: "comboId ",
Name: "comboName ",
HiddenName: "comboName"
});
// Note: After the HiddenName attribute is added, the ComboBox is its id, and the result is the display value ..
2. The second problem is that after the data has been loaded, there are also values in the store, and it is not displayed in ComboBox. Please note whether valueField and displayField are set in your ComboBox, valueField is bound to the current underlying data, which is equivalent to its id and displayValue. It is bound to the nouns corresponding to the current underlying data, as the name suggests, that is, the displayed value. Also, check whether the ing and field are correctly written. If these two attributes do not exist, the values cannot be displayed. Another point is that the value obtained is passed back from the server, so remember to have response. getWrite (). print (json format value); sometimes the foreground is correctly written, but there is still no value, that is, the value is not uploaded to the foreground
Store: new Ext. Data. Store ({
Proxy: new Ext. Data. httpProxy ({}),
Reader: new Ext. data. JsonReader ({});
Field: ["valueid", "displayName"]
});
New Ext. form. ComboBox ({
Id: "comboId ",
Name: "comboName ",
HiddenName: "comboName ",
Store: store
ValueField: "valueid", // it must correspond to the field, otherwise it cannot match correctly
DisplayField: "dispalyField"
});
3. Obtain the manually entered value of ComboBox. The manually entered value is not completely set to the value in ComboBox. Therefore, when we get the value, it is an empty string.
Listeners :{
Render: function (f ){
F. el. on ('keyup', function (e ){
F. setValue (f. getRawValue ());
VipStore. proxy = new Ext. data. HttpProxy ({
Url: "vip_realtimeVipName.action? VipID ="
+ F. getRawValue ()
});
VipStore. load ();
});
}
These problems will always be encountered accidentally. Pay more attention to them ..