[html]
用下拉列表编辑
[Js]
//用下拉列表编辑
var editor2 = new Ext.Editor({
shadow: false,
completeOnEnter: true,
cancelOnEsc: true,
updateEl: true,
ignoreNoChange: true,
listeners: {
complete: function (editor, value, oldValue) {
Ext.Msg.alert('文本被改变', "从“" + oldValue + "” 变为“" + value + "”");
}
},
field: {
width: 110,
id: "combo1",
//renderTo: 'div2',
triggerAction: 'all',
xtype: 'combo',
editable: false,
forceSelection: true,
store: ['下拉项1', '下拉项2', '下拉项3']
}
});
var panel = new Ext.Panel({
renderTo: "div2",
width: 200,
height: 50,
collapsible: true,
layout: 'fit',
title: '请双击标题',
listeners: {
afterrender: function (panel) {
panel.header.titleCmp.textEl.on('dblclick', function (event, label1_dom) {
editor2.startEdit(label1_dom);
});
}
}
});
|