VuetableRowHeader
VuetableRowHeader component is responsible for rendering all the table header columns using the field definition object of each field. It also handles interaction when the user click on the column header by calling appropriate function to do sorting (single or multi-sort).
Vuetable specifies VuetableRowHeader component as a default header component in the header-rows prop.
Components
By default, it registers some Field Components to provide backward compatibility with earlier version of Vuetable.
It will also toggles VuetableColGutter when using Vuetable with Fixed Header.
Methods
stripPrefix
params:
- name:
String
- name:
returns:
Stringusage:
This function will remove the prefix as set in the Vuetable's
field-prefixprop from the given parameter.
headerClass
params:
- base:
String - field:
Object
- base:
returns: array of
Stringusage:
This function generates CSS classes for the given field.
toSnakeCase
params:
- str:
String
- str:
returns:
Stringusage:
This function will return the snake-case version of the given parameter.
sortClass
params:
- field:
Object
- field:
returns:
Stringusage:
This function generates specific ascending/descending CSS class for the sortable field. This gives you more control on the appearance of the sortable field.
See all:
css.ascendingClasscss.descendingClass
sortIcon
params:
- field:
Object
- field:
returns:
Stringusage:
This function generates specific ascending/descending CSS class for icon in sortable field.
See all:
css.ascendingIconcss.descendingIcon
isInCurrentSortGroup
params:
- field:
Object
- field:
returns:
Booleanusage:
This function checks if the given field is in the current sort group.
See also:
sort-orderprop
hasSortableIcon
params:
- field:
Object
- field:
returns:
Booleanusage:
This function checks whether the given field has sortable icon defined.
See also:
css.sortableIcon
currentSortOrderPosition
params:
- field:
Object
- field:
returns:
Numberorfalseusage:
This function returns the position index in the current sort order if the field is in the sort order, otherwise, returns false.
See also:
sort-orderprop
renderTitle
params:
- field:
Object
- field:
returns:
Stringusage:
This function returns a complete title consisting of sort icon. In case of multiple sort, a proper opacity of the sort icon is also generated via
sortIconOpacityfunction.
getTitle
params:
- field:
Object
- field:
returns:
Stringusage:
This function returns a proper title defined in field definition object. If the defined title is a function, it will call the function and use the returned result. If the title is not defined, it will return the field name instead.
sortIconOpacity
params:
- field:
Object
- field:
returns:
Numberusage:
This function calculates the opacity of the sort icon of the given field in the multi-column sorting. The opacity value will vary according to the sort position, the first one will be the most opaque and the subsequence position will have more opacity.
renderIconTag
params:
- classes: array of
String - options:
String
- classes: array of
returns:
Stringusage:
This function will generate icon tag using the default
<i>tag or the one returned by thecss.renderIconif it is defined.
onColumnHeaderClicked
params:
- field:
Object - event:
Event
- field:
returns:
noneusage:
This function will be called when the user click on the column header and it will call Vuetable's
orderByfunction to handle the sorting accordingly.