kor TürkçeGitHub

Compare

Puts offers or versions side by side.

kor/ui/CompareSource

When to use

  • Use it for quotations, document versions and products.

Examples

Quotations

Loading the example

<k:Compare rows="{path: '/rows', templateShareable: false}">
	<k:columns>
		<k:CompareColumn key="a" title="Anadolu Metal" text="Current supplier"/>
		<k:CompareColumn key="b" title="Ege Çelik" actionText="Choose"/>
		<k:CompareColumn key="c" title="Nord Steel" actionText="Choose"/>
	</k:columns>
	<k:rows><k:CompareRow label="{label}" values="{values}" best="{best}" unit="{unit}" group="{group}"/></k:rows>
</k:Compare>

API

Properties

NameTypeDefaultDescription
onlyDifferencesbooleanfalseWhether to show only rows that differ
togglebooleantrueWhether to show the differences switch
labelstringAccessible name
baselineint0Index of the baseline column. Use -1 for none

Aggregations

NameTypeDescription
columnsCompareColumn[]Things being compared
rowsCompareRow[]Fields

Events

NameTypeDescription
columnPresskey: stringA column button was pressed

Methods

NameDescription
differs(row: CompareRow): booleanWhether the values of a row differ.

CompareColumn

A comparison column.

Properties

NameTypeDefaultDescription
keystringKey
titlestringTitle
textstringSubtitle
statusTextstringStatus text
statestringStatus. Hidden when empty
actionTextstringButton text

CompareRow

A comparison row.

Properties

NameTypeDefaultDescription
labelstringField name
valuesanyValues in column order
groupstringGroup heading
beststringUse min or max to mark the best number
decimalsint0Decimal places
unitstringUnit

Related

PivotDetails