所以我有一个两列的网格,第一列只有文本,第二列需要有一个自定义控件(带有一个复选框和一个组合框)
检查屏幕:
这是一个screenie的链接:
问题:_
当我单击更新以更新行时。第一列得到更新,但第二列没有
我天真地getValue()
在我的自定义控件中添加了一个,但没有运气!(注意:我使用的是行编辑插件)
这是我的代码:
Ext.define('MainGrid', {
extend: 'Ext.grid.Panel',
//defs for all the toolbars and buttons
plugins: [rowEditing],
columns: [
{
xtype: 'rownumberer'
},
{
xtype: 'gridcolumn',
text: 'Column Titles',
dataIndex: 'ColumnTitle',
editor: {
xtype: 'textfield',
}
},
{
xtype: 'gridcolumn',
sortable: false,
align: 'center',
dataIndex: 'IssueCondition',
editor: {
xtype: 'reportpopulation'
}]
});
这里reportpopulation
是自定义控件。这是它的代码:
Ext.define('SelectPopulation', {
extend: 'Ext.container.Container',
itemId: 'ctrSelectpopulation',
alias: 'widget.reportpopulation',
layout: {
type: 'hbox'
},
initComponent: function () {
//code to add combo box and checkbox snipped
....
},
getValue: function () {
//This doesn't work!
return "Booo";
}
});
所以点击更新不会:
- 有什么我想念的吗?
- 我应该从 FieldBase 继承吗?我可以使用多个控件并使用 FieldBase 创建类似于 screenie 的东西吗?