locked
In a ListView, how do I bind a class to a DIV?

    Question

  • I have a div that I want to set the CSS class of it based on the data that is bound in the template. How do I do that? I've tried:

    data-win-bind="class: cssclassdata"

    and

    data-win-bind="cssClass: cssclassdata"

    but neither work. Help?

    Friday, April 27, 2012 5:06 AM

Answers

  • Try using:

    data-win-bind="className: cssclassdata"

    • Proposed as answer by jrboddie Friday, April 27, 2012 5:10 PM
    • Marked as answer by SpatacoliMVP Friday, April 27, 2012 7:41 PM
    Friday, April 27, 2012 5:10 PM

All replies

  • Try using:

    data-win-bind="className: cssclassdata"

    • Proposed as answer by jrboddie Friday, April 27, 2012 5:10 PM
    • Marked as answer by SpatacoliMVP Friday, April 27, 2012 7:41 PM
    Friday, April 27, 2012 5:10 PM
  • Of course it is... I'm a moron. Thank you!

    Todd

    Friday, April 27, 2012 7:42 PM