1.1.8 • Published 3 years ago

vue-awesome-grid v1.1.8

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

vue-awesome-grid

forthebadge forthebadge

How it works?

demo

Build the component

$ npm install
$ npm run build

Component is build to

  • CommonJS/UMD javascript module
  • an ES6 javascript module

Usage

import Vue from 'vue';
import { VueAwesomeGrid } from 'vue-awesome-grid';

Vue.use(VueAwesomeGrid);

Tip: too many props to pass? v-bind can help

<template>
  <div>
    <!-- Too much code: -->
    <simple-component
      :g="1"
      :r="2"
      :i="3"
      :d="4">
    </simple-component>

    <!-- Do the same thing but simplier -->
    <simple-component v-bind="$data" />
  </div>
</template>
<script>
export default {
  data: () => ({
    g: '1',
    r: '2',
    i: '3',
    d: '4'
  });
}
</script>

Reference

VueAwesomeGrid props

PropertyDescriptionTypeDefaultMandatory
columnsdefinition of columns (see below)array-Yes
datadata of the current pagearray-Yes
totaltotal number of the records (if set to 0, then total block is disabled)number0Yes
filteredtotal number of filtered recordsnumber-No
queryquery objectobject-Yes
summarysummary rowHTMLTableRowElement-No
headerSettingswhether to render headerSettingsbooleantrueNo
paginationwhether to render paginationbooleantrueNo
pageSizeOptionsoptions for page size selectarray10, 25, 100No
noDataPlaceholderplaceholder for grid in case empty data in tablestring(No Data)No
extraPropsobject for extra props, which will be passed to dynamic componentsobject-No

columns

KeyDescriptionTypeDefaultMandatory
titledisplayed title of columnstring-Yes
labellabel in headerSettings (title will take its place if not set)string-No
fieldfield name of the row in data structurestring-No
sortableis sortable?booleanfalseNo
visibleis visible?booleantrueNo
tdCompdynamic component for 'td'string/object-No
tdClassclasses for tdstring or function(value, row)-No
tdStyleinline styles for tdobject-No
thClassclasses for thstring-No
renderformatting functions for displayfunction(value, row)-No
clickEventcallback cell clickedfunction(value, row)-No

query

KeyDescriptionTypeDefault
limitcount of entries to returnnumber10
offsetreturn data since this entry numbernumber0
orderdirection, asc or descstring""
sortsort field namestring""
searchsearch stringstring""

And anything else you might need (this parameters must be implemented in backend).

summary

Row that is located at the bottom of the table and shows additional resulting information about the data. By default, the summary row is not showing. To show it you must set it to object with similar structure, as the row in table.

extraProps

Is used to pass additional properties to nested components. For example, you can pass bus object for events.

ROW_UPDATED

If the data of one row is updated and you don't need to update the whole data object, you can call ROW_UPDATED event to update only one row. You must pass one parameter to event with the folowing structure: { id: idValue, data: newRowData}.

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.2

3 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago