2
我想將一個按鈕添加到網格中,以便用戶可以通過傳入按鈕行中的值來查看給定任務的時間表條目值。網格加載得很好,直到我將該按鈕添加到columnCfgs。當按鈕在那裏,我得到一個「Uncaught TypeError:Object [object Object]沒有方法'setSortState'」錯誤。如何在網格上添加自定義按鈕並傳遞行值?
{text:'View Time',
xtype: 'button',
listeners: {
click: Ext.bind(this._viewTimeEntryValues(projectId, taskId), this)
}
},
滿格代碼:
this.grid = this.add({
xtype: 'rallygrid',
model: model,
defaultSortToRank: true,
showRowActionsColumn: false,
columnCfgs: [
{text:'View Time',
xtype: 'button',
listeners: {
click: Ext.bind(this._viewTimeEntryValues(projectId, taskId), this)
}
},
{text:'Id', dataIndex:'FormattedID'},
{text:'Name', dataIndex:'Name'},
{text:'Project', dataIndex:'Project'}
],
storeConfig: {
context: {
projectScopeUp: false,
projectScopeDown: true
},
filters: this._activeFilters
}
});
- 你如何添加自定義按鈕,一個網格?
- 你如何傳遞按鈕行的值?
謝謝你!那就是我一直在尋找的! –
不客氣 – nickm