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

myapp.SelectMultiSelect.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.GDPItemsByCountries.CollectionView = collectionView;
    c1.cba.Utils.bindPagerState(contentItem.screen, collectionView, { next: 'NextPage', previous: 'PreviousPage' });
};

myapp.SelectMultiSelect.NextPage_canExecute = function (screen) {
    return screen.GDPItemsByCountries.isLoaded;
};

myapp.SelectMultiSelect.NextPage_execute = function (screen) {
    screen.GDPItemsByCountries.CollectionView.moveToNextPage();
};

myapp.SelectMultiSelect.PreviousPage_canExecute = function (screen) {
    return screen.GDPItemsByCountries.isLoaded;
};

myapp.SelectMultiSelect.PreviousPage_execute = function (screen) {
    screen.GDPItemsByCountries.CollectionView.moveToPreviousPage();
};

myapp.SelectMultiSelect.Countries_render = function (element, contentItem) {
    var input = new c1.cba.Select($(element), contentItem);
};
