I'm trying to change a ko.observable value when clicking on a jquery.DataTables table-row to the id of that row. I'm instantiating the DataTable in durandal's attached function after I fetched data from the server in the activate cycle. Even without any on-click logic, I can't get it to change the observable value after I instantiated the Datatable.
code below:
self.attached = function(view, parent) {
self.selectedCategory().schedule_id(1337);
self.dt = $('#reservation_schedule_table').DataTable();
}
works fine. But, when I write it like this,
self.attached = function(view, parent) {
self.dt = $('#reservation_schedule_table').DataTable();
self.selectedCategory().schedule_id(1337);
}
I get a cyclic object error.
TypeError: cyclic object value
return JSON.stringify(ko.utils.unwrapObservable(data), replacer, space);
knockou...7981312 (line 537, col 19)
Can somebody tell me why that is and how to prevent this from happening?