Posted 20 August 2019, 8:34 am EST
Hello!
I have met an issue while working with the FlexGrid DetailProvider and can’t figure out a way with the workaround for this because it seems that it’s related to the wijmo itself. So what I need is to have details only for the specific rows, for example, for indexes 1, 3, 4, 6 in the grid with 10 rows. The issue is that the wijmo renders details on correct rows, but if I’ll open row details rows with details will be changed almost randomly.
So, for the code, for example, we have this in the component
rowsWithDetails = [1, 3, 4, 6];
Then we’ll have a ngOnInit which will set detailsProvider, I have taken this from the Row Details for Angular 2 introduction
ngOnInit() {
this.data = new wjcCore.CollectionView(this.dataSvc.getData(10));
const dp = new wjcGridDetail.FlexGridDetailProvider(this.flex);
dp.maxHeight = 250;
dp.createDetailCell = (row) => {
var cell = document.createElement('div');
cell.innerHTML = 'Test';
return cell;
}
dp.rowHasDetail = this.flexGridRowHasDetails.bind(this);
}
And finally, a method which will detect if passed row has details
flexGridRowHasDetails({ index }) {
return this.rowsWithDetails.some(rowNumber => rowNumber === index);
}
Then to reproduce the issue open details under the row with Index 3 and observe the result: plus sign disappears from the row with index 4 and disappears from index 6 and appears on index 5.
Wijmo version is 5.20183.568, also the bug reproduces on latest release version 5.20192.624