KoGrid
KoGrid copied to clipboard
Lost selected items on filter
Hi, I'm using KoGrid 2.1.1 , with knockout-3.4.1. I declared 2 observable arrays in my model:
self.Siti = ko.observableArray([]);
self.SitiSelezionati= ko.observableArray([]);
I popolated "Sites" with "complex" object:
function sitoObject(_id, _titolo, _url, _gruppoReader) {
var self = this;
self.Id = ko.observable(_id);
self.Titolo = ko.observable(_titolo);
self.Url = ko.observable(_url);
self.GruppoReader = ko.observable(_gruppoReader);
}
I declared KoGrid:
<div class="gridStyle" data-bind="koGrid: {
**data: Siti,**
primaryKey: 'Id',
showFilter: true,
enableSorting: true,
multiSelect: true,
paging: true,
selectWithCheckboxOnly: false,
**selectedItems: SitiSelezionati,**
footerVisible: false,
displaySelectionCheckbox: true,
columnDefs: [{
field: 'Titolo', displayName: 'Sito'
}]
}">
</div>
The items are correctly loaded, If I click an item the grid put it in "SitiSelezionati" array, but when I apply the filter on the grid, I loose previous selected item.
What am I doing wrong?
thanks for support!