Ext Combobox 多选时候,数据取回后设定默认。

setValue( String|Array value ) : Ext.form.field.Field
Sets the specified value(s) into the field. ...

Sets the specified value(s) into the field. For each value, if a record is found in the store that matches based on the valueField, then that record's displayField will be displayed in the field. If no match is found, and the valueNotFoundText config option is defined, then that will be displayed as the default field text. Otherwise a blank value will be shown, although the value will still be set.

Parameters

  • value : String|Array

    The value(s) to be set. Can be either a single String or Ext.data.Model, or an Array of Strings or Models.

Returns

  • Ext.form.field.Field

    this

单一:Ext.getCmp("1945").setValue(“1”);

多个:用数组

var value=[1,2,3];

Ext.getCmp("1945").setValue(value.split(','));

你可能感兴趣的:(String,ext,each)