Subclass with additional controls

edited January 2015 in Newbie Questions
Hi,

I am new to enyo. I am trying to extend the existing kind to add one more control. For example, the BaseControl is the kind that contains a label. I want to create a new kind that inherits from the BaseControl kind and add one more TextArea to it. Please refer the below code. But the Subkind overwrites the components of the BaseControl instead of extend. Please help how to add additional controls in the subkind instead of overwriting. Thanks!
	name: "BaseControl",
	content: "ContentText",
	fit:true,
	published: {
		data : null
	},
	components: [
		{
			name:"dividerTitle",
		},],
	create: function() {
		this.inherited(arguments);
		this.data = {
			comments:""
		};

		this.$.dividerTitle.setContent(this.caption);
	},
});

enyo.kind({
    name: "SubControl",
    kind: "BaseControl",
    components: [
        {
            kind: "onyx.InputDecorator", style: "width: 90%;", components: [
            { kind: "onyx.TextArea", style: "width: 100%;padding:5px;", onchange: "inputChanged" }
            ],
        }
    ],
});

Comments

Sign In or Register to comment.