2012-01-04 43 views
1

我需要在rowexpander中顯示一個表單。爲了做到這一點,我打算創建一個臨時div作爲rowexpander的一部分,然後在expandbody事件中附加一個表單。不過,我很困惑如何爲RowExpander註冊expandbody監聽器。ExtJS4 Grid with RowExpander

請幫幫我。

謝謝

回答

2

你確定你不想使用正規roweditor嗎?或者彈出窗口並將記錄加載到窗體中?


編輯: 如果這是你想要的,然後只要按照從Sencha的例子。 基本上所有你要做的就是指定一個你想要在插件配置中呈現數據的模板。您不需要聽取擴展事件來呈現數據。

plugins: [{ 
      ptype: 'rowexpander', 
      rowBodyTpl : [ 
       '<p><b>Company:</b> {company}</p><br>', 
       '<p><b>Summary:</b> {desc}</p>' 
      ] 
     }], 
+0

我覺得我沒有正確地解釋所採取的例子。我想要的只是顯示有關擴大的行的更多細節。我不想編輯一行,而是想顯示有關表格或表格中展開的行的更多詳細信息。謝謝 – Chir 2012-01-05 05:14:56

+0

我需要在第二個網格行rowBodyTpl請幫助我 – RaviPatidar 2015-02-11 08:57:30

2

使用'pluginId'屬性訪問RowExpander插件對象。

這裏是the RowExpander docs

var grid = Ext.create('Ext.grid.Panel', { 

    plugins: [{ 
     ptype: 'cellediting', 
     clicksToEdit: 2, 
     pluginId: 'cellplugin' 
    }] 
}); 



// later on: 

var plugin = grid.getPlugin('cellplugin');