Ext.form.ComboBox 的editable设为true之后,用getValue()是无法获取手工输入的值,对于带可编辑功能的ComboBox,我们需要getRawValue()来取值。
比较两个两个方法的原型和说明:
getRawValue():Mixed
Returns the raw data value which may or may not be a valid, defined value. To return a normalized value see getValue().
getValue():String
Returns the currently selected field value or empty string if no value is set.
注意:虽然getValue()返回的类型是String,而getRawValue()返回的是Mixed,这个Mixed可以被当作String运算和处理。
比较两个两个方法的原型和说明:
getRawValue():Mixed
Returns the raw data value which may or may not be a valid, defined value. To return a normalized value see getValue().
getValue():String
Returns the currently selected field value or empty string if no value is set.
注意:虽然getValue()返回的类型是String,而getRawValue()返回的是Mixed,这个Mixed可以被当作String运算和处理。