Skip to content

change in ng-grid.d.ts #2923

Closed
Closed

Description

@lucamorelli

Hi,
in the ng-grid.d.ts file I needed to do a change in the export interface IGridOptions:
I had to change from columnDefs?: IColumnDef[] to columnDefs?: any, otherwise I cannot write $scope.gridOptions.columnDefs = "colDefs", assigning to the columndef property another variable in the scope.
Looks me this notation is very used to assign dinamically the column definitions.

Activity

  1. vvakame commented on Oct 6, 2014

    @vvakame
    Member

    @lucamorelli I can't found your usecase in http://ui-grid.info/docs/#/api/ui.grid.class:GridOptions.columnDef
    Do you have any information?

  2. lucamorelli commented on Oct 6, 2014

    @lucamorelli
    Author

    you can look at
    https://github.com/angular-ui/ng-grid/wiki/Defining-columns

    this is a Running sample
    $scope.colDefs = [];

            $scope.gridOptions = new MyOptions();
            $scope.gridOptions.data = "datiPalmari";
            $scope.gridOptions.columnDefs = "colDefs";
            $scope.gridOptions.enableColumnResize = true;
            $scope.gridOptions.enableCellSelection = true;
            $scope.gridOptions.selectedItems = $scope.selectedCells;
    

    ...

                var reportPromise = dispositivi.reportPalmari($scope.progettoCorrente);
                reportPromise.then(function (gridData: Factories.reportHeader) {
                    $scope.colDefs = gridData.giorni;
                    $scope.datiPalmari = gridData.palmari;
                },
                function (reason) {
                    alert('errore in recupero lista dispositivi: ' + reason);
                }, function (update) {
                    alert('Got notification: ' + update);
                });
    

    Looks like this is a general problem known to the TypeScript team

    microsoft/TypeScript#805
    microsoft/TypeScript#824

    they're actually working with union types

  3. lucamorelli commented on Oct 6, 2014

    @lucamorelli
    Author

    btw: are we talking ng-grid or ui-grid? Any plans to support ui-grid too?

  4. vvakame commented on Oct 8, 2014

    @vvakame
    Member

    @lucamorelli Had been misunderstood. I'm sorry.
    It supported if someone crelle pull request. thanks! 😉

  5. orta commented on Jun 7, 2021

    @orta
    Collaborator

    Hi thread, we're moving DefinitelyTyped to use GitHub Discussions for conversations the @types modules in DefinitelyTyped.

    To help with the transition, we're closing all issues which haven't had activity in the last 6 months, which includes this issue. If you think closing this issue is a mistake, please pop into the TypeScript Community Discord and mention the issue in the definitely-typed channel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions