File

src/ui/grid/services/smart-grid-util.service.ts

Index

Methods
Accessors

Methods

getGridRowHeight
getGridRowHeight()

Measures the height of a single row in a Kendo UI Grid by creating a temporary grid off-screen and measuring the height of the first row

Returns : number
  • The height of a single grid row in pixels
isHeaderTitleTruncated
isHeaderTitleTruncated(th: HTMLElement | null)

Whether the header title is truncated in the live DOM.

Parameters :
Name Type Optional Description
th HTMLElement | null No
  • The column header cell
Returns : boolean
  • True when the title overflows its box
measureBadgeNaturalWidth
measureBadgeNaturalWidth(badgeEl: HTMLElement, measureCell?: HTMLElement)

Measures the snug width of a rendered badge host (smart-badge element).

Parameters :
Name Type Optional Description
badgeEl HTMLElement No
  • The smart-badge host element
measureCell HTMLElement Yes
  • Optional grid badge cell wrapper
Returns : number
  • The natural width of the badge in pixels
measureBadgeNaturalWidthForText
measureBadgeNaturalWidthForText(text: string, measureContext: ISmartGridBadgeMeasureContext)

Measures a badge that displays plain text (no value-list entry).

Parameters :
Name Type Optional Description
text string No
  • Display text
measureContext ISmartGridBadgeMeasureContext No
Returns : number
  • The natural width of the badge in pixels
measureBadgeNaturalWidthForValue
measureBadgeNaturalWidthForValue(valueList: ValueList, valueKey: string, measureContext: ISmartGridBadgeMeasureContext, badgeComponentRef?: ComponentRef<SmartBadgeComponent>)

Measures badge width by rendering the real SmartBadgeComponent offscreen with the same value list and key as the grid cell (SCLNG-1521).

Parameters :
Name Type Optional Description
valueList ValueList No
  • The column value list
valueKey string No
  • The data value / value-list key
measureContext ISmartGridBadgeMeasureContext No
badgeComponentRef ComponentRef<SmartBadgeComponent> Yes
Returns : number
  • The natural width of the badge in pixels
measureColumnFilterNaturalWidth
measureColumnFilterNaturalWidth(root: HTMLElement, field: string)

Measures the filter row cell natural width for a column.

Parameters :
Name Type Optional Description
root HTMLElement No
  • Grid root element
field string No
  • Column field name
Returns : number
  • Filter cell width in pixels
measureColumnHeaderNaturalWidth
measureColumnHeaderNaturalWidth(th: HTMLElement | null, columnTitle: string, columnHeaderMeasureHost?: HTMLElement, gridRoot?: HTMLElement)

Measures the natural width required to show the column header title (and optional header buttons from the live DOM) without truncation.

Parameters :
Name Type Optional Description
th HTMLElement | null No
  • The column header cell, when rendered
columnTitle string No
  • The column title text
columnHeaderMeasureHost HTMLElement Yes
gridRoot HTMLElement Yes
Returns : number
  • Minimum column width for the header in pixels
measureMaxBadgeNaturalWidthFromData
measureMaxBadgeNaturalWidthFromData(dataItems: any[], field: string, measureContext: ISmartGridBadgeMeasureContext, valueList?: ValueList, skipKeys?: Set, seedMax: number, seedWidestKeys: string[])

Returns the widest natural badge width for distinct field values in the provided data rows. Reuses one offscreen SmartBadgeComponent per pass (SCLNG-1521).

Parameters :
Name Type Optional Default value Description
dataItems any[] No
  • Grid data rows currently in memory
field string No
  • The badge column field name
measureContext ISmartGridBadgeMeasureContext No
valueList ValueList Yes
  • The column value list, when configured
skipKeys Set<string> Yes
  • Value keys already measured from the DOM
seedMax number No 0
  • Widest width from prior measurement passes
seedWidestKeys string[] No []
  • Keys tied for seedMax
Returns : literal type
  • Widest badge width

Accessors

rowHeight
getrowHeight()

The height of a single grid row in pixels

Returns : number

results matching ""

    No results matching ""