Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lost selected items on filter #314

Open
angelogulisano opened this issue Feb 18, 2017 · 0 comments
Open

Lost selected items on filter #314

angelogulisano opened this issue Feb 18, 2017 · 0 comments

Comments

@angelogulisano
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant