-
Notifications
You must be signed in to change notification settings - Fork 66
lesson 20
- set
fieldsprop - set
api-modetofalse - set
dataprop - set
data-totalprop - set
data-managerprop
Note
What we discuss in this lesson is the way to supply offline (or pre-loaded) data to Vuetable.
This means that you still have to provided other props that Vuetable needs in order to work as expected. For example, you still have to provide fields definition in thefieldsprop.
You can use data prop to set the data for Vuetable-2.
data prop can accept either
- an "Array" of data, or
- an object containing the data and pagination information.
If you just want to use Vuetable to display the data you already have, you can set those data array to the data prop. Vuetable will use the data provided to render HTML table. VuetablePagination and VuetablePaginationInfo will not work in this scenerio since no pagination information is available.
To do that, you will have to
- provide fields definition in the
fieldsprop - enable Data mode by setting
:api-mode="false" - pass your data array in the
dataprop, or callsetDatamethod to pass your data in.
If you not only want to use offline (or pre-loaded) data with Vuetable but also VuetablePagination and/or VuetablePaginationInfo to still work as in the API mode, you have to provide data object containing both data and pagination info to the data prop.
To do that, you will have to
- provide fields definition in the
fieldsprop - enable Data mode by setting
:api-mode="false" - pass your data object in the
dataprop, or callsetDatamethod to pass your data object in. This will be the initial data that will be rendered when Vuetable is loaded. - provide the total number of data rows in
data-totalprop, so that the pagination component can perform correctly. - set the data manager function to handle the data that will be sent to Vuetable for rendering.
- Your first Vuetable
- Displaying more fields
- Cleaning up code
- Make change to field title
- Column alignment
- Format fields using
callbackoption - Adding pagination
- Displaying pagination information
- Customizing Vuetable
- Make columns sortable
- Using special fields
- Adding Detail Row
- Adding Search Filter
- Moving Field Definitions to another file
- Passing Props to MyVuetable - Part 1
- Passing Props to MyVuetable - Part 2
- Passing Scoped Slot to MyVuetable
- Using Twitter's Bootstrap CSS with Vuetable
- Pagination for Twitter's Bootstrap