I’m developing HTML5 app with Knockout.js and JayData and I encountered a problem while implementing a pull-to-refresh data list.
I query a remote OData service with JayData API and assign the results to a KO observable array:
db.MySet
.orderBy('it.Field1')
.skip(recordsToSkip)
.take(20)
.toArray()
.then(function(result) {
self.MyDataList(result);
}
I always lose the old records. How could I fix my code?
I guess there is a small thing missing while bindig the result to the Knockout observable: check if the existing array already contains elements and append the result to the existing ones.
My colleague Viktor has a tutorial, which implements a highscore list with Knockout+JayData pull-to-refresh
Does this fix the app?
The full context of the example can be found on GitHub