由于某种奇怪的原因,我无法绑定checkboxToggle属性设置为true的fieldset的值。因此,它的配置如下所示:
xtype: "fieldset",
title: "Box",
checkboxName: "bounding_box",
checkboxToggle: true,
bind: {
collapsed: "{!rec.bounding_box}"
} // results in error message: TypeError: this[c._config.names.set] is not a function
// bind: "{!rec.bounding_box}" does not work either因此,上面的代码不起作用。然而,同样的技术也适用于简单的checkbox字段:
xtype: "checkbox",
fieldLabel: "Show label",
name: "show_label",
bind: "{rec.show_label}"这有什么问题?我该如何修复它?
发布于 2016-07-17 22:52:42
如果你在一个调试版本中运行,你会得到一条错误消息,告诉你它不能绑定,因为在字段集上没有setCollapsed方法。您可以很容易地添加它:
Ext.define('AddSetCollapsed', {
override: 'Ext.form.FieldSet',
setCollapsed: function(collapsed) {
if (collapsed) {
this.collapse();
} else {
this.expand();
}
}
});https://stackoverflow.com/questions/38422402
复制相似问题