How to make a control within a list style itself correctly?

edited September 2013 in Newbie Questions
I am relatively new to Enyo and have been just learning the ins and outs. I am encountering a problem that I don't really know why it happens. I have a screen that looks something like this:
enyo.kind({

	name: "p_mixed_list_test",
	kind: "Screen",
	layoutKind: "FittableRowsLayout",
	components: [
			{name:"Generated28", kind:"block",
		components: [
					{name:"myMixedList", kind:"mixedList",
			components: [
						{name:"cell", kind:"cell",
					components: [
							{name:"Generated29", kind:"label"},
					]
					},
			]
			},
		]
		},
  	],
I am trying to add a background-color to the cell kind. It does not work. I will post the code for that kind:
enyo.kind({
	name:"cell",
	kind: "Control",
	published: {
		"background-color":""
	},	
	create: function() {
		this.inherited(arguments);
		this.addClass("cell");
	},
	rendered: function() {		
		this.inherited(arguments);
	},
	bindData: function() {
		this.addStyles("background-color:"+this["background-color"]+";");
	}
I will also include the components for the mixedList as it might be necessary:
enyo.kind({
	name: "mixedList",
	kind:"Control",
	components: [
		{name:"list", 
			kind:"List",
			fit: true,
			touch: true,
			multiSelect: false,
			reorderable: false, 
			centerReorderContainer: false,
			enableSwipe: false,
			onSetupItem: "setupItem",
			components: [
				{name: "item", fit:true, components: [
					{name:"index", style:"display:none;"}
				]},
				{name: "empty", fit:true, content:""},
				{name: "loadmore", fit:true, content:"Load More Items"}
			]
		},
	],
When adding the background to the cell from within the Screen it works using the $ notation, but I should not be doing it from there. I could alternatively do it from the mixedList if possible, but have not been getting any results. Can someone explain to me why I can't add the style from within the cell kind? Appreciate your time.

Comments

Sign In or Register to comment.