I am attempting to create an array of contract line items (CLINs) that will be displayed as individual div elements below a header of general contract informati
For anyone who wants to get the length of an observableArray without the _destroyed items, you can use this function:
ko.observableArray.fn.totalVisible = function() {
var items = this(), count = 0;
if (items == null || typeof items.length === "undefined") {
return 0;
}
for (var i = 0, l = items.length; i < l; i++) {
if (items[i]._destroy !== true) {
count++;
}
}
return count;
};
Then to use it:
myObservableArray.totalVisible();