/// <reference path="../GeneratedArtifacts/viewModel.js" />
/// <reference path="../Scripts/wijmo.cba.js" />

myapp.GridEditingRow.FlexGrid_render = function (element, contentItem) {
    var grid = new c1.cba.FlexGrid($(element), contentItem);
    var collectionView = new c1.cba.LightSwitchCollectionView(contentItem);
    grid.wjControl.itemsSource = collectionView;
    contentItem.screen.GDPItems.CollectionView = collectionView;
    c1.cba.Utils.bindPagerState(contentItem.screen, collectionView, { next: 'NextPage', previous: 'PreviousPage' });
};

myapp.GridEditingRow.DeleteSelected_canExecute = function (screen) {
    return screen.GDPItems.selectedItem != null && !screen.details.properties.GDPItems.isReadOnly;
};

myapp.GridEditingRow.DeleteSelected_execute = function (screen) {
    screen.GDPItems.deleteSelected();
    screen.GDPItems.CollectionView.onCollectionChanged();
};
