Problem description:
When Combobox is used in PropertyGrid to select a value, the value of displayField is obtained, but the value of valueField is displayed when you confirm the selection. For example, select gender from the drop-down list, displayField is 'male', 'female ', and valueField is '0' and '1' respectively. Therefore, the Chinese description should be displayed, however, the data is displayed as 0 or 1, which is unacceptable to users.
Solution:
Block the beforepropertychange event of the Grid, set the displayed value, and return false to prevent verification resetting in the modification event.
For example:
Copy codeThe Code is as follows:
Listeners :{
Beforepropertychange: function (source, recordId, value, oldValue ){
If (recordId = 'brand _ name '){
Var record = this. getStore (). getById (recordId );
This. suspendEvents ();
Record. set ("value", cmbBrandEdit. store. getAt (cmbBrandEdit. store. find ('brand _ id', value). get ('brand _ name '));
Record. commit ();
This. resumeEvents ();
Return false;
}
}
}