繁体   English   中英

如何在extjs 3中使用textfield列创建编辑器网格面板

[英]How to create the editor grid panel with textfield column in extjs 3

我已经使用extjs在该网格面板中创建了一个编辑器网格面板,默认情况下,列应与文本字段一起加载

var Grid= new Ext.grid.EditorGridPanel({
    store:checkpoint,
    renderTo:'testgrid',
    autoHeight:true, 
    border:false,
    clicksToEdit: 1,
    columns: [ {header:'Check Points',
                 menuDisabled: true,
             dataIndex: 'checkpoints',
             valueField:'Id',
             width:300,
            },
             {
                 menuDisabled: true,
                 header:'Report',
                 dataIndex: 'developerreport',
                 renderer:  function (v,p) {
                     p.attr += ' ext:qtip=" click to edit"';
                     return v; 
                   } ,

                 editor:  new Ext.form.ComboBox({

                    hideTrigger: true, 
                    name: 'comment',
                    id:'comment',
                    mode: 'local',
                    store: names,
                    displayField: 'role',
                    triggerAction: 'all',
                    emptyText:'Select Role',
                    allowBlank:     false,
                    editable:       false,
                    forceSelection: true}),},
                   {header:'Comment',
                     menuDisabled: true,
                     dataIndex: 'developercomment',
                     renderer:  function (v,p) {
                        p.attr += ' ext:qtip=" click to add"';
                         return v;
                      } ,

                     editor: new Ext.form.TextField({
                        }),}],
              viewConfig: {
                    deferEmptyText: false,
                    forceFit: true,
                    emptyText: '<p style="font-size: 13px;color:red;">Please fill the above details</p>',
                    },

                });

我想评论字段应加载文本框,有什么办法

提前致谢

无法立即使用EditorGridPanel做到这EditorGridPanel ,因为AFAIK当时支持一个编辑器。 可能最简单的解决方案是创建渲染器,该渲染器将内容渲染为HTML input ,然后将事件附加到该输入。 您还可以使用applyTo config属性为每个HTML输入创建组件。

使用applyTo工作示例: http : //jsfiddle.net/N2wYX/6/

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM