{
header:'项目明细',
flex: 1,
sortable: true,
dataIndex: 'itemname',
hideable: true,
editor : {
xtype: 'combobox',
displayField: 'itemname',
value:'itemname',
typeAhead: true,
width: 200,
labelWidth: 200,
store: qureystore,
triggerAction: 'all',
valueField : 'itemname',
forceSelection :false,
selectOnFocus :false,
listConfig: {
getInnerTpl: function() {
return '<div data-qtip="{content}">{itemname}</div>';
}
},
listeners : {
render : function(f)
{
f.el.on('change', function(e) {
f.setValue(f.getValue());
f.setRawValue(f.getValue());
qureystore.proxy= new Ext.data.HttpProxy({
model:'qurey',
url : "stock_qurey2.asp?name=" + f.getValue(),
method : 'POST',
reader : new Ext.data.JsonReader({
root : "rows",
totalProperty : 'total',
id: 'id'
},qurey)
})//说明数据结构
qureystore.load();
f.originalValue= f.getValue();
});
},
select:function(f,records,e)
{
}
}
}
}现在的问题是当第一次输入新值的时候,combobox正常保存,可当我再次点击刚才输入的编辑框后,combobox会被清空。如果是从combobox选择出来的值就不会出现这种情况。有点迷惑。我猜想,grid每次引用的是同一个combobox对象,每次点击都会被初始化。
我从网上找了很多代码,但没解决问题,之前的版本是用editor :new Ext.form.filed.combocox({})创建,但是在ext4.0里面无效。有用过的么,谢谢指教!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货