当前位置: 代码迷 >> JavaScript >> How to get dispayfield in extjs combo
  详细解决方案

How to get dispayfield in extjs combo

热度:664   发布时间:2013-10-19 20:58:22.0
How to get dispayfield in extjs combo?

转: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;}




  相关解决方案