I have the following problem. I want to check that the item clicked on in table is not the same as model.selected.
var model= {
items: ko.observableArray(),
selected : ko.observable()
};
<tbody>
<!-- ko foreach: model.items -->
<tr data-bind="click:$parent.model.set_selected_item">
<td style="cursor:pointer" data-bind="varchar : title"></td>
</tr>
<!-- /ko -->
</tbody>
//ID is an observable
//selected may not be set yet - i.e an empty observable;
var set_selected_item = function(item){
//if item is different set
model.LandItem_selected(item);
do_routine(item)
//else
//do nothing
}
because the item is an observable is is never null; how would I check if the observable has not been set yet?
Any help much appreciated.