转:http://stackoverflow.com/questions/5680330/how-to-get-dispayfield-in-extjs-combo
Use the value to get the record out of the store, and get the display value from there.
Abstractly, you can use this code, but you might substitute some of the variables for known values to make it more readable:
getComboDisplay =function(combo){var value = combo.getValue();var valueField = combo.valueField;var record;
combo.getStore().each(function(r){if(r.data[valueField]== value){
record = r;returnfalse;}});return record ? record.get(combo.displayField):null;}
本文提供了一个简明的代码示例,用于从ExtJS组合框中获取值对应的记录及其显示字段值,包括如何使用getValue()、valueField、getStore()等方法。
1086

被折叠的 条评论
为什么被折叠?



