Реализация AG-GRID с рендерингом на стороне сервера в Angular 6 - PullRequest
0 голосов
/ 28 сентября 2018

Я реализовал ag-grid в angular 6 и включил рендеринг на стороне сервера, когда сервер попадает в конечную точку, где хранятся данные, но не поступает ответ на внешний интерфейс, и нет также журнала ошибок

<div style=" box-sizing: border-box;" class="ag_customtable">

<ag-grid-angular #agGrid style="width: 100%; height: 100%;" id="myGrid" [rowData]="rowData" class="ag-theme-balham" [columnDefs]="columnDefs"  [enableSorting]="true" [enableFilter]="true" [suppressRowClickSelection]="true"  [debug]="true" [rowSelection]="rowSelection" [enableColResize]="true"   [enableRangeSelection]="true" [paginationAutoPageSize]="true" [pagination]="true" [defaultColDef]="defaultColDef" (gridReady)="onGridReady($event)" (cellClicked)="openModalDialog1($event)">
</ag-grid-angular>

onGridReady(params)
  {

    this.gridApi = params.api;

    this.gridColumnApi = params.columnApi;

   this.xorusapiService.assettable_data().subscribe(data => 
        {

        this.rowData = data;

        });



  }

Я получаю сервер

    ag-Grid.Context: >> creating ag-Application Context
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.Context: bean [object O created
ag-Grid.GridCore: ready
ag-Grid.Context: >> ag-Application Context ready - component is alive
ag-Grid.BalancedColumnTreeBuilder: Number of levels for grouped columns is 0
ag-Grid -> initialised successfully, enterprise = false
inside _ assetable data
/export
/export
ag-Grid.SelectionController: reset
ag-Grid.SelectionController: reset

/ export - это конечная точка, к которой я прибегаю

Может ли кто-нибудь помочь мне решить эту проблему?

1 Ответ

0 голосов
/ 12 октября 2018

Я столкнулся с этой проблемой, и это было из-за стиля.На самом деле данные загружались, но сетка не отображалась в пользовательском интерфейсе.Я изменил стиль на style = "width: 100%; height: 700px;"чтобы решить это.

<ag-grid-angular #agGrid style="width: 100%; height: 700px" id="myGrid" [rowData]="rowData" class="ag-theme-balham" [columnDefs]="columnDefs"  [enableSorting]="true" [enableFilter]="true" [suppressRowClickSelection]="true"  [debug]="true" [rowSelection]="rowSelection" [enableColResize]="true"   [enableRangeSelection]="true" [paginationAutoPageSize]="true" [pagination]="true" [defaultColDef]="defaultColDef" (gridReady)="onGridReady($event)" (cellClicked)="openModalDialog1($event)">
</ag-grid-angular>
...