Hi Bryntum , We have a feature where the rows should be colored alternatively . so for this we implemented a custom class which is similar to stripe(feature) but with our business logic.
the below line of code doesn't seem to return all of the rows.
const rows = await grid.rowManager.rows;
the whole code
export default (base) =>
class CombineStripe extends base {
static get $name() {
return 'combineStripe';
}
async construct(grid, config) {
super.construct(grid, config);
// adds the colors to the rows
await this.addColorToRows(grid);
}
doDisable(disable) {
if (!this.isConfiguring) {
// Refresh rows to add/remove even/odd classes
this.client.refreshRows();
}
super.doDisable(disable);
}
/** add colors to 2 rows alternatively */
async addColorToRows(grid) {
const rows = await grid.rowManager.rows;
const mainObjectMap = new Map();
let isColor = true;
console.log(rows);
for(let row of rows) {
const mo = row.cellContext._record._data.mainObject;
if(mainObjectMap.get(mo) === undefined) {
mainObjectMap.set(mo, []);
}
mainObjectMap.get(mo).push(row);
}
mainObjectMap.forEach((values,key) => {
if(key !== undefined) {
for(let row of values) {
row.assignCls({
'b-add-color-row': !isColor,
})
}
}
isColor = !isColor;
});
}
};
we have upto 10 resources .
but when i try to get the rows by doing
await grid.rowManager.rows I can only get until RO-000007
due to this reason there seems to be bug that occurs when our custom code is ran. Could you please tell us why this is happening .Thank you.