I´m new with Ractive, working on my firt project.
I have a table like this
{{#each physicianList}}
<tr on-click="testFunction:{testNumber: {{.testNumber}}}"
style="background-color: {{.testNumber == {testNumberSelected} ? '#cce5ff' : 'inherit'}}">
<td>{{.testNumber}}</td>
</tr>
{{/each}}
When one row is clicked, I want to change the background of that row.
function testFunction(ev, cfg) {
var rjs = this;
testNumber = cfg.testNumber;
rjs.set('testNumberSelected', testNumber);
}
It doesn´t work
I think the problem must be here:
{{.testNumber == {testNumberSelected} ? '#cce5ff' : 'inherit'}}
Am I missing anythings?
Thanks for your help.
several ractive syntax errors,
like:
when you have a ractive data array like:
as you see you need the dot before the key to access the key in the each array item
I found a solution to your problem: