Thanks for the feature. But unfortunately, I am unable to use this with column binding from JSON.
|
app.component.html
<ejs-grid [dataSource]='data' height='500' [columns]="orderColumns"> </ejs-grid>
………………………………………………………………….
app.component.ts
export class AppComponent {
public data: Object[] = [];
public orderColumns: ColumnModel[];
ngOnInit(): void {
this.data = orderDetails;
this.orderColumns = [
{
field: "OrderID",
headerText: "Order ID",
width: "180",
textAlign: "Right"
},
……………………………………
{
field: "ShipCountry",
headerText: "Ship Country",
width: "180",
freeze: "Right",
minWidth: 10
},
];
this.orderColumns.forEach(column => {
if (column.field === "CustomerName") {
column.freeze = "Right"; //From you code example, we have iterated
} the columns and provide the freeze for particular column.
});
}
} |