if possible to implement in angular 2 code using
1)when i click checkbox cellEditEnding not fired getting error
ERROR TypeError: ‘ownKeys’ on proxy: trap returned duplicate entries
<wj-flex-grid #flexGrid [ngClass]=“{‘animated’: animated}”
headersVisibility=“Column”
showSelectedHeaders=“All”
[alternatingRowStep]=“0”
[showMarquee]=“true”
[autoGenerateColumns]=“false”
[columnGroups]=“columns”
(initialized)=“initializeGrid(flexGrid)”
[itemsSource]=“data”>
initializeGrid(flex: wjcGrid.FlexGrid) {
flex.cellEditEnding.addHandler((s: wjcGrid.FlexGrid, e: wjcGrid.CellEditEndingEventArgs) => {
debugger;
let col = s.columns[e.col].binding;
// update the original value
// when the ratin start is clickced
if (col === “Favorite”) {
const item = s.rows[e.row].dataItem;
item.favorite = !item.favorite;
s.collectionView.refresh();
}
});
flex.cellEditEnded.addHandler((s: wjcGrid.FlexGrid, e: wjcGrid.CellEditEndingEventArgs) => {
debugger;
let col = s.columns[e.col].binding;
switch (col) {
case “pdf”:
let valuePdf = s.getCellData(e.row,e.col,false)
// update excel value
s.setCellData(e.row, “excel”, !valuePdf);
console.log(e);
s.collectionView.refresh();
break;
case “excel”:
let valueExcel = s.getCellData(e.row, e.col,false);
// update excel value
s.setCellData(e.row, “pdf”, !valueExcel);
s.collectionView.refresh();
break;
}
});
// let g = new ColumnGroupProvider(flex, this.columns);
// //uncomment next line if you would like to select col range on click on column headers
// g.selectOnClick = true;
}
constructor(private reportService:ReportService) {
this.ratingTemplate = CellMaker.makeRating({
range: [0, 1]
});
this.reportLink = CellMaker.makeLink({
});
this.reportService.reportUpdate().subscribe(data=>{
})
this.reportService.GetAllReportCategorieswithJson().subscribe(data=>{
this.reportsData=data['GetAllReportCategoriesResult'];
this.reportsData=Object.values(this.reportsData);
// this.reportsData=Object.keys(data).map(function(key) {return this.reportsData[key];})
this.reportsData.forEach(data=>{
this.reportName=data.Name;
this.reportsDataReports.push(...data.Reports);
})
this.reportsDataReports.forEach((element,index)=>{
Object.assign(this.reportsDataReports[index],{
pdf: false,
excel: false,
html: false,
})
element.Email == 1 ? element.pdf = true : element.Email == 2 ? element.excel = true : element.Email == 3 ? element.html = true : ' '
})
})
setTimeout(() => {
this.data = new wjcCore.CollectionView(this.reportsDataReports, {
calculatedFields: {
Favorite: $ => +$.favorite
}
});
}, 500);
this.columns = [
{
header: “Favorite”,
binding: “Favorite”,
cellTemplate: this.ratingTemplate,
align: “center”
},
{
header: “Subscription”,
columns: [
{ header: “PDF”, binding: “pdf” },
{ header: “Excel”, binding: “excel” },
{ header: “HTML”, binding: “html” }
]
},
{ header: “Type”, binding: “reportName”, width: 250 },
{ header: “Report Name”, binding: “Name”, cellTemplate: this.reportLink, width: 500 }
];
}