<ej-grid #grid [allowPaging]="true" [pageSettings]="{pageSize: 2}" [dataSource]="GridDataManager" (actionComplete)="onPaging($event)" (dataBound)="onCreate($event)">
<e-columns>
<e-column headerText="Lines" [template]="columnTemplate" width=600 textAlign="right"></e-column>
</e-columns>
</ej-grid>
export class GridComponent {
public columnTemplate = "#columnTemplate";
}
Index.html
<script type="text/x-jsrender" id="columnTemplate">
<span id="container{{:OrderID}}"></span>
</script> |
onCreate(e){
//Acces cell values using currentViewData
var data = e.model.currentViewData;
for(var i = 0; i < data.length; i++){
$("#container" + data[i].OrderID).ejChart({
series:
[{
dataSource: data,
xName: "Freight",
yName: "EmployeeID",
type: "line"
}],
});
}
}
onPaging(e){
if(e.requestType == "paging") {
//Acces cell values using currentViewData
var data = e.model.currentViewData;
for(var i = 0; i < data.length; i++) {
$("#container" + data[i].OrderID).ejChart({
series:
[
{
dataSource: data,
xName: "Freight",
yName: "EmployeeID",
type: "line"
}
]
});
}
}
} |