Files
dc/client/src/app/editor/utils/renderers.utils.ts
Mihajlo Medjedovic cd3e0f614b
Some checks failed
Build / Build-and-ng-test (pull_request) Failing after 23s
chore: adding comments part 3
2023-08-04 12:05:00 +02:00

59 lines
1.1 KiB
TypeScript

/**
* Custom renderer for HOT cell
* Used to show error icon
*/
export const errorRenderer = (
instance: any,
td: any,
row: number,
col: number,
prop: string,
value: any,
cellProperties: any
) => {
td.innerHTML = `${
value ? value.toString() : ''
} <clr-icon shape="exclamation-circle" status="warning"></clr-icon>`
return td
}
/**
* Custom renderer for HOT cell
* Used to revert cell back to original state (no spinner, no error)
*/
export const noSpinnerRenderer = (
instance: any,
td: any,
row: number,
col: number,
prop: string,
value: any,
cellProperties: any
) => {
td.innerHTML = value ? value : ''
return td
}
/**
* Custom renderer for HOT cell
* Used to show loading spinner in the cell
* (Spinner shown whilst waiting for SAS to respond)
*/
export const spinnerRenderer = (
instance: any,
td: any,
row: number,
col: number,
prop: string,
value: any,
cellProperties: any
) => {
td.innerHTML = `${
value ? value.toString() : ''
} <span class="spinner spinner-sm vertical-align-middle"></span>`
return td
}