mdtColumn

Description

Representing a header column cell which should be placed inside mdt-header-row element directive.

Dependencies

Usage

as element:
<mdt-column
       [align-rule="{string}"]
       [sort-by="{function()}"]
       [column-definition="{string}"]>
</mdt-column>

Parameters

ParamTypeDetails
alignRule
(optional)
string

align cell content. This settings will have affect on each data cells in the same column (e.g. every x.th cell in every row).

Assignable values:

  • 'left'
  • 'right'
sortBy
(optional)
function()

compareFunction callback for sorting the column data's. As every compare function, should get two parameters and return with the comapred result (-1,1,0)

columnDefinition
(optional)
string

displays a tooltip on hover.

Example

<mdt-table>
    <mdt-header-row>
        <mdt-column align-rule="left">Product name</mdt-column>
        <mdt-column
            align-rule="right"
            column-definition="The price of the product in gross.">Price</mdt-column>
    </mdt-header-row>

    <mdt-row ng-repeat="product in ctrl.products">
        <mdt-cell>{{product.name}}</mdt-cell>
        <mdt-cell>{{product.price}}</mdt-cell>
    </mdt-row>
</mdt-table>