ashfaq.p
ashfaq.p

Reputation: 5469

How to dynamically give ID to ag-grid?

I am using ag-grid for dataTables. I have created a component which consists of ag-grid. A unique ID is passed as input to this component and I want to give this id as grid id.

<ag-grid-ng2 #agGrid class="ag-fresh" [gridOptions]="gridOptions" [columnDefs]="columnDefs"
[rowData]="rowData">

So i want to make this id #agGrid to be dynamic.

How can I achieve this ?

Upvotes: 4

Views: 4130

Answers (1)

jgood044
jgood044

Reputation: 36

You should be able to do use any of the following to set a unique id:

  • [id]="dynamicId"
  • [attr.id]="dynamicId"
  • id={{item.dynamicId}}

Upvotes: 1

Related Questions