I have a checkbox in html table. Using knockoutjs, I am binding my html table to json object. Untill now everything works fine. But when I apply tablesorter, checkbox that is previously checked gets unchecked. It happens after Buildtable() function is called from the code listed below. Browser I am using is IE6. Not sure if its a brower issue. Don't have access to anyother browser currently. Any help would be appreciated.
Thanks
<div id="unassignedDiv" style="text-align:center;display:none;">
<table class="tablesorter" id="unassignedTable">
<thead><tr>
<th align="center">Date</th>
<th align="center">Rush?</th>
</thead></tr>
<tbody id="resultsbody" data-bind="template: { name: 'resultsTemplate', foreach: Results }"></tbody></table>
<script id="resultsTemplate" type="text/html">
<tr><td data-bind="text: dateneeded" align="center"></td>
<td align="center">
<input type="checkbox" data-bind="checked:rushindicator" disabled="disabled" />
</td>
</tr>
</script>
</div>
//Build JsonObject
BuildArray = function () {
var searchjson = {
"Results": [
{ "dateneeded": "11/08/12", rushindicator: true },
{ "dateneeded": "11/10/12", rushindicator: false }]};
};
BuildResultsPage = function () {
$j('#unassignedDiv').show();
var resultArray = BuildArray();
exported.viewmodelExpanded = ko.mapping.fromJS(resultArray);
ko.applyBindings(exported.viewmodelExpanded, $j('#unassignedDiv')[0]);
BuildTable(); //If this is commented, html loads checkbox with checked.
};
BuildTable = function () {
$j("#unassignedTable").tablesorter({ widgets: ['zebra'], widgetZebra: { css: ["oddcolor", "evencolor"] },
sortInitialOrder: 'desc',
headers:
{
0: { sorter: 'Date' },
1: { sorter: false }
}
}).tablesorterPager({ container: $j("#pager"), removeRows: true });
};