2.3.0 • Published 4 years ago

oe-data-table v2.3.0

Weekly downloads
9
License
MIT
Repository
github
Last release
4 years ago

\<oe-data-table>

<oe-data-table> is a component for displaying data in tabular format. It is a Polymer component styled with Material Design Data Table Standards. It can be used to add, edit and delete data in a model which has a embedded/hasMany relation. Also to display the entries in a model

The data to be shown is set to items and columns to show is set to columns.

PropertyDescription
showAccordianTo display accordian view in each row
accordianElementComponent name to be displayed in accordian expanded view
disableConfigEditorIf set to true, config editor would be disabled
maxHeaderHeightSet height of the header (in px)
showEditOptionsTo display edit options in header toolbar

Defining Columns

The column(s) to show in the table can be configured using the columns property. The columns property takes an array of objects which can have the following properties.

Column propertyDescription
keyThe key of the row to get data from.
labelThe string to be shown in column header.
typeThe type of the content that is shown in the column. For example date, timestamp, number, string.
uitype(Deprecated. use type) The type of the content that is shown in the column. For example date, timestamp.
uiTypeThe input control that has to be used for inline editing.
readOnlyBoolean flag denoting whether the column is non editable in inline mode , by default it is false.
widthWidth of the column in px.
minWidthMin Width of the column in px, by default grid level min width will be taken.
alignmentAlignment of the cell content , can have left,right or center .
sortSort order of the current column. Takes either asc or desc.
firstToSortWhether to sort first by desc or asc, by default it is asc.
formatterA custom formatting function which returns the value to show in the cell.
rendererA custom rendering function which returns the element to show in the cell.
hrefTakes an express styled path and shows the cell content as a hyperlink with the provided path. For example, href="/models/customer/:id".
cellClassClass to apply on data table cell
cellClassRulesObject having class name to be applied as key and an expression to evaluate as value
valueGetterA custom getter function which returns a value for the property specified in the key.
hiddenColumn will be hidden if it is set to true.
autoFittable height should be set by user when this property is true.

Styling

<oe-data-table> provides the following custom properties and mixins for styling:

Custom propertyDescriptionDefault
--oe-data-tableMixin to be applied to whole table{}
--oe-data-table-headerMixin to be applied to the table header{}
--oe-data-table-header-titleMixin to be applied to the table header title{}
--oe-data-table-rowMixin to be applied to the table row{}
--oe-data-table-row-selectedMixiin to be applied to the table row when selected{}
--oe-data-table-row-hoverMixin to be applied to the table row on hover{}
--oe-data-table-row-firstMixin to be applied to the first row of the table{}
--oe-data-table-row-lastMixin to be applied to the last row of the table{}
--oe-data-table-dataMixin to be applied to the table cell{}
--oe-data-table-column-firstMixin to be applied to the first column{}
--oe-data-table-column-lastMixin to be applied to the last column{}
--oe-data-table-selection-cell-contentMixiin to be applied to the selection cell content if provided{}
--oe-data-table-row-actionMixin applied to the row action icon buttons{}
--oe-data-table-dataMixin to be applied to table-data class to set min-height{}
--oe-data-table-selection-checkboxMixin to be applied to table selection checkbox{}
--edit-controlMixin applied to set the height of edit cell{}