0
我有以下的淘汰賽綁定和JavaScript淘汰賽CSS結合表選定行
<table id="tblall" border="0" class="table table-hover" width="100%">
<tbody data-bind="foreach: myinfo">
<tr id="Tr1" style="cursor: pointer" >
<td data-bind="click: $parent.selectIt, css: { 'red': $parent.isSelected == $data } "></td>
<td data-bind="text: $parent.isSelected"></td>
</tr>
</tbody>
</table>
和這個JavaScript
function (logger, system, router) {
var isSelected = ko.observable();
---
---
-
--
var vm = {
isSelected:isSelected,
selectit: function(row, event) {
isSelected(row.id);
}
當我選擇一排它正在改變isselected但CSS永遠不會改變。
謝謝,是它,需要$ data.id – user1167777