Nico
Nico

Reputation: 333

AG-Grid 'columnMoved' event never fires

I want to save my grid state to local storage whenever the user re-order columns.

I thought maybe I'm just using the wrong event name, but tried various variations including dragStopped without any luck

The onColumnMoved method in my code never get executed in the following:

            <ag-grid-angular 
                #someGrid  class="ag-theme-balham" 
                [rowData]="model" 
                [columnDefs]="colDefs"
                [enableFilter]="true" 
                [enableSorting]="true" 
                [animateRows]="true" 
                [enableRangeSelection]="true" 
                [enableColResize]="true"
                rowSelection="multiple" 
                (selectionChanged)="onSelectionChanged()"
                (columnMoved )="onColumnMoved($event)">
            </ag-grid-angular>```


I'm using the free version for what it matter, Angular 6

Upvotes: 0

Views: 1053

Answers (1)

TheParam
TheParam

Reputation: 10571

I think the event is not firing because there is space after (columnMoved ) event If you remove that space then the code will work.

<ag-grid-angular 
                #someGrid  class="ag-theme-balham" 
                [rowData]="model" 
                [columnDefs]="colDefs"
                [enableFilter]="true" 
                [enableSorting]="true" 
                [animateRows]="true" 
                [enableRangeSelection]="true" 
                [enableColResize]="true"
                rowSelection="multiple" 
                (selectionChanged)="onSelectionChanged()"
                (columnMoved )="onColumnMoved($event)">
            </ag-grid-angular>

Here is solution on plunker

Upvotes: 2

Related Questions