我是Ext JS的新手,我想知道是否可以创建Textfield或其他组件并将其插入网格面板单元格中。到目前为止我已经尝试了这个(它没有给我返回组件):
{
header : ...,
id : ...,
dataIndex : ...,
sortable : true,
width : 140,
renderer: function(value, meta, record) {
return new Ext.form.TextField({fieldLabel: 'field', text: 'test'});
}
}
我想用cellEditing做类似的事情,但是我无法使用该插件,因为我正在使用旧版本的Ext(3.2.1)。
我的目标是在有人点击特定单元格时显示文本。
谢谢。
答案 0 :(得分:0)
https://fiddle.sencha.com/#fiddle/27e7&view/editor
我在列渲染器中返回了html输入字段。
就像单元格编辑器一样,我已经为textfield设置了值。我还添加了模糊事件处理程序方法,您可以在其中编写类似于单元格编辑器编辑监听器的代码。
这是你想要的吗?或者其他一些变化。检查一下。 在这里添加代码:renderer: function (value, meta, record) {
return "<input onblur='onBlurEventHandler(event)' value="+value+" style='width: 90 px;'></input>"
}
function onBlurEventHandler(event){
console.log('Value: '+event.currentTarget.value);
}