I am working in MVC3 with knockout in a simple table.
I want to apply some alternate row styling so I did
<tr data-bind="css: { altrow: $index()%2 }">
This worked great.
Next I wanted to apply a special row styling for special rows. So I did
<tr data-bind="css: { altrow: $index()%2 } ,css: { specialrow: IsSpecial == true }">
This worked OK. It appears to be stripping the CSS off of every line and then applying if the row is special. So it eliminates the alternate shading.
I would just like this to override any existing CSS if it exists.
Anyway I am a little stuck, and new to all of this. And my searches have turned up confusing results.
Thanks for the help!
You cannot have two bindings with the same name for the same element. Knockout will only use the second one. The
cssbinding allows you specify more than one class though.