2012-09-17 38 views
1

我創建使用的ExtJS在默認情況下,列該網格面板一名編輯網格面板應與文本框如何創建帶有3

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>', 
        }, 

       }); 

我要評論領域應該載入加載ExtJS的文本字段列編輯網格面板與文本框,有沒有辦法提前

+0

你想有一個文本框向右走,沒有進入編輯模式? – Krzysztof

+0

是的,我需要像進入編輯模式之前的文本框 –

回答

0

感謝它不可能EditorGridPanel做直了,因爲據我所知它支持當時的一名編輯。可能最簡單的解決方案是創建渲染器,渲染內容爲HTML input,然後將事件附加到該輸入。您還可以使用applyTo配置屬性爲每個HTML輸入創建組件。

使用 applyTo

工作樣本:http://jsfiddle.net/N2wYX/6/