import { isNullOrUndefined } from '@syncfusion/ej2-base' ; import { Column } from '../models/column' ; import { Cell } from '../models/cell' ; import { ICellRenderer } from '../base/interface' ; import { CellRenderer } from './cell-renderer' ; import { headerCellInfo } from '../base/constant' ; hidden export class StackedHeaderCellRenderer extends CellRenderer implements ICellRenderer < Column > { public element : HTMLElement = this . parent . createElement ( 'TH' , { className : 'e-headercell e-stackedheadercell' , attrs : { role : 'columnheader' , tabindex : '-1' } } ) ; param { Column } column param { Object } data param { Element } public render ( cell , data , attributes ? ) { let node = this . element . cloneNode ( ) as Element ; let div = this . parent . createElement ( 'div' , { className : 'e-stackedheadercelldiv' } ) ; node . appendChild ( div ) ; div . innerHTML = cell . column . headerText ; if ( cell . column . toolTip ) { node . setAttribute ( 'title' , cell . column . toolTip ) ; } if ( ! isNullOrUndefined ( cell . column . textAlign ) ) { ( div as HTMLElement ) . style . textAlign = cell . column . textAlign ; } node . setAttribute ( 'colspan' , cell . colSpan . toString ( ) ) ; node . setAttribute ( 'aria-colspan' , cell . colSpan . toString ( ) ) ; node . setAttribute ( 'aria-rowspan' , '1' ) ; this . parent . trigger ( headerCellInfo , { cell , node } ) ; return node ; } }