Alexander
Alexander

Reputation: 20224

XTemplate and style

I have an XTemplate for tooltips

tooltipTpl: new Ext.XTemplate(
'<dl class="eventTip">',
'<table width="100%"><tr>',
'<td width="10%">',
'<table><tr>',
'<td><dt class="entry_{EventType}"></dt></td>',
...

which renders completely and all data is shown and the class is applied correctly.

Then I added a new field to all records in the store at runtime:

eventRec.set('evtColor',"#EFEFEF");

and added the new field to the template:

tooltipTpl: new Ext.XTemplate(
'<tpl exec="console.log(values.evtColor);"></tpl>',
'<dl class="eventTip" style="background-color:{values.evtColor};">',

The result is that #EFEFEF is logged to console, but the tooltip is rendered neither completely nor with #EFEFEF as background-color.

Why is that? How do I get the background color into the tooltip?

Upvotes: 0

Views: 290

Answers (1)

matt
matt

Reputation: 4047

You don't need to prepend values. when using curly brackets, just use {evtColor} and it should work.

Upvotes: 1

Related Questions