I have the following view model:
function instance(id, FirstName){
$.extend(this, {
id: ko.observable(id || ''),
FirstName: ko.observable(FirstName || '')
});
}
I have some instances in an observableArray:
ko.observableArray([new instance(...), new instance(...), ...]
With the following template:
<ul data-bind='template: {name: "instanceTemplate", foreach: instances}'></ul>
And another template:
<ul data-bind='template: {name: "anotherInsTmpl", foreach: instances}'></ul>
In first ul I need to render templates without sorting, in the second one render sorted by FirstName.
Can anyone explain how to do it?