App.component.ts
// Dynamically create footer rows
-------------this.footerRows[4]['columns'].push({ type: 'Custom', field: `arrayOfWeeks.week${i}.displayedText`, footerTemplate: '${Custom}%', customAggregate: this.displayRatio.bind(this, i), customAttributes: {class: 'percentcell'} });
dataBound(args) {
this.vacationsGrid.autoFitColumns(['fullName']);
// get the summary cell containing percent value by using the class percentcell
var percentcell = document.querySelectorAll('.e-movablefootercontent .e-summaryrow .percentcell')
for (var i=0; i<percentcell.length; i++){
if((percentcell[i] as any ).innerText != ''){
// get the percent value
var percentcellval = parseInt( percentcell[i].getAttribute("aria-label").split(' ')[0])
if( percentcellval >= 49 ){
// get the all the summary row
var summaryrows = document.querySelectorAll('.e-movablefootercontent .e-summaryrow')
for (var j=0; j<summaryrows.length ; j++){
//get the column cell which having more than 50% and add a custom class to it
summaryrows[j].querySelectorAll('.e-summarycell')[i].classList.add('styleclass')
}
}
}
}
}
App.component.scss
/**************************************************************/ /* FOOTER CONTENT STYLING */
/**************************************************************/
.VacationsGrid .footerCell, .VacationsGrid .percentcell, .VacationsGrid .footerFirstCellOfMonth {
padding: 0 !important;
border-width: 1px 0 0 1px;
font-size: 11px;
font-family: HelveticaNeue-Medium, sans-serif !important;
}
/**************************************************************/
/* FOOTER CELL STYLING IF PERCENT EXCEEDS 50 */
/**************************************************************/
.VacationsGrid .styleclass {
background-color: orangered;
border-color: orangered;
}
|