首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

How to get dispayfield in extjs combo

2013-10-19 
How to get dispayfield in extjs combo?转:http://stackoverflow.com/questions/5680330/how-to-get-disp

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

热点排行