KoGrid
KoGrid copied to clipboard
Selected Row Not Updated When kgGrid.SelectedItems Changed
I'm trying to select & highlight a newly added item to koGrid.data. After adding the new item to the ko.observableArray data-bind to kgGrid.SelectedItems from view model, the previous selected row remains highlighted, whereas the newly added item is not highlighted even if it has become the "active" selected object.
Could you please check if there's a css update event which can be triggered by SelectedItems changes.
Thanks a lot!
skyscaler - > when you push an new item to the koGrid data collection your previous selected items are still selected ? because every time I push a new item to grid collection my selected items are lost .
run2esc ->In my case, the previous selected items are lost, but they remain highlighted, until a mouse click triggers a toggleSelection; whereas the newly items are "selected", but not highlighted. So I suspect SelectedItems change event doesn't trigger css update properly.
When you selected items are lost, they remain highlighted (css: .kgRow.selected)?
I think is a problem with selected items when adding/updating items from grid . Is this a known issue.problem >? Is there a workaround ?
I'm wanting to do the same thing (change the selection by removing and adding to the selectedItems observable array). Here's a demo where it's not working for me: http://plnkr.co/edit/hVjzwPaUVNm6mIVEEeA6
Here's a hacked up version of your demo that works. It appears that the grid doesn't listen to the viewModel probably because it doesn't have an "Update" in it's binding handler. Also, the rowindex is 1 based for the rowFactory's rowCache.
http://plnkr.co/edit/f65ertoYJSH1xJiTiNie?p=preview