Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在编辑extjs网格行之前调用组合框的combo.Setvalue在4.2中使用,但在6.2中没有_Extjs_Extjs4.2_Extjs6 - Fatal编程技术网

在编辑extjs网格行之前调用组合框的combo.Setvalue在4.2中使用,但在6.2中没有

在编辑extjs网格行之前调用组合框的combo.Setvalue在4.2中使用,但在6.2中没有,extjs,extjs4.2,extjs6,Extjs,Extjs4.2,Extjs6,在4.2中编辑时,在beforeedit函数中调用的combo.setvalue(id)显示显示值,但在6.2中显示为空 combo.getStore().load(); combo.getStore().on('load', function(){combo.setvalue(id)}) 正在6.2中工作,但在行准备好编辑后需要时间。尝试使用此功能,存储从4.2更改为6.2,可能在设置onload侦听器之前加载完成 combo.getStore().load(function(){ c

在4.2中编辑时,在beforeedit函数中调用的combo.setvalue(id)显示显示值,但在6.2中显示为空

combo.getStore().load();
combo.getStore().on('load', function(){combo.setvalue(id)})

正在6.2中工作,但在行准备好编辑后需要时间。

尝试使用此功能,存储从4.2更改为6.2,可能在设置onload侦听器之前加载完成

combo.getStore().load(function(){
   combo.setValue(id);
});
组合框也应该由valuefield设置,所以如果设置正确,请阅读组合配置。如果不必使用valuefield,则可以使用

combo.setRawValue(id);

More specified example

    // The data store containing the list of states
var states = Ext.create('Ext.data.Store', {
    fields: ['abbr', 'name'],
    data : [
        {"abbr":"AL", "name":"Alabama"},
        {"abbr":"AK", "name":"Alaska"},
        {"abbr":"AZ", "name":"Arizona"}
    ]
});

// Create the combo box, attached to the states data store
Ext.create('Ext.form.ComboBox', {
    fieldLabel: 'Choose State',
    store: states,
    queryMode: 'local',
    displayField: 'name',
    valueField: 'abbr',
    listeners:{
      render: function(combo){
          combo.setValue('AL');
      }  
    },
    renderTo: Ext.getBody()
});