HTML:
<div data-bind="koGrid: gridOptions" style="height:600px;border:solid 1px #ccc;"></div>
JS:
Column Definitions:
{ field: 'orderCatalogUpdateID', cellTemplate: '<button data-bind="click: $userViewModel.removeItem">X</button>', displayName: ' ', width: '2%' }`
removeItem function in ViewModel:
self.removeItem = function (item) { self.list.remove(item); }
item that is passed to the removeItem function is not a row bound data item, but rather a KoGrid column. How can I get a data item bound to a string to pass it to the remove function in an observable array?
I tried to hook click events using jQuery and a lot of cell templates trying to pass a data item bound to a string without success.
Daveb source share