Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I set an element's class using data-win-bind

I'm trying to dynamically set the class of a listview item template:

<div id="semanticZoomTemplate" data-win-control="WinJS.Binding.Template" style="display: none">
    <h1 class="semanticZoomItem-Text" data-win-bind="innerText:title;class:contains"></h1>
</div>

But data-win-bind fails to do anything when 'class' is present as a property-name.

Is there a correct way to styling specific items in a listview if indeed I can't change the class with data-win-bind?

like image 601
dannyfritz Avatar asked May 17 '12 20:05

dannyfritz


1 Answers

You need to set the JavaScript class property, which is not called "class", but "className".

like image 112
ChristiaanV Avatar answered Oct 31 '22 06:10

ChristiaanV