0.1.91 • Published 5 years ago

gridvue2 v0.1.91

Weekly downloads
16
License
MIT
Repository
github
Last release
5 years ago

Gridvue2

The Gridvue2 is a GridView that view mode displays a list of data items by binding data fields to columns and by displaying a column header to identify the field. The default GridView style implements buttons as column headers. By using buttons for column headers, you can implement important user interaction capabilities; for example, users can click the column header to sort GridView data according to the contents of a specific column.

Screenshot

Default theme screen shot link Default theme screen shot

Installation

npm install --save gridvue2

Basic Usage

Add this lines on top of your main.js:

import Vue from 'vue'
import GridVue2 from 'gridvue2'

Vue.component('gridvue2', GridVue2)

Add these lines in your vue file:

<template>
  <div id="app">
    <gridvue2 :Items="items" :Config="config" :Titles="titles"></gridvue2>
  </div>
</template>

<style>
  @import "~gridvue2/dist/css/gridvue2.css";
</style>

<script>
export default {
  data: function () {
    return {
      titles : [],
      config: {},
      items: [
        {
          "first_name": "Rebbecca",
          "last_name": "Didio",
          "company_name": "Brandt, Jonathan F Esq",
          "address": "171 E 24th St",
          "city": "Leith",
          "state": "TAS",
          "post": 7315,
          "phone1": "03-8174-9123",
          "phone2": "0458-665-290",
          "email": "rebbecca.didio@didio.com.au",
          "web": "http://www.brandtjonathanfesq.com.au"
        },
        {
          "first_name": "Stevie",
          "last_name": "Hallo",
          "company_name": "Landrum Temporary Services",
          "address": "22222 Acoma St",
          "city": "Proston",
          "state": "QLD",
          "post": 4613,
          "phone1": "07-9997-3366",
          "phone2": "0497-622-620",
          "email": "stevie.hallo@hotmail.com",
          "web": "http://www.landrumtemporaryservices.com.au"
        },
        {
          "first_name": "Mariko",
          "last_name": "Stayer",
          "company_name": "Inabinet, Macre Esq",
          "address": "534 Schoenborn St #51",
          "city": "Hamel",
          "state": "WA",
          "post": 6215,
          "phone1": "08-5558-9019",
          "phone2": "0427-885-282",
          "email": "mariko_stayer@hotmail.com",
          "web": "http://www.inabinetmacreesq.com.au"
        },
        {
          "first_name": "Gerardo",
          "last_name": "Woodka",
          "company_name": "Morris Downing & Sherred",
          "address": "69206 Jackson Ave",
          "city": "Talmalmo",
          "state": "NSW",
          "post": 2640,
          "phone1": "02-6044-4682",
          "phone2": "0443-795-912",
          "email": "gerardo_woodka@hotmail.com",
          "web": "http://www.morrisdowningsherred.com.au"
        },
        {
          "first_name": "Mayra",
          "last_name": "Bena",
          "company_name": "Buelt, David L Esq",
          "address": "808 Glen Cove Ave",
          "city": "Lane Cove",
          "state": "NSW",
          "post": 1595,
          "phone1": "02-1455-6085",
          "phone2": "0453-666-885",
          "email": "mayra.bena@gmail.com",
          "web": "http://www.bueltdavidlesq.com.au"
        },
        {
          "first_name": "Idella",
          "last_name": "Scotland",
          "company_name": "Artesian Ice & Cold Storage Co",
          "address": "373 Lafayette St",
          "city": "Cartmeticup",
          "state": "WA",
          "post": 6316,
          "phone1": "08-7868-1355",
          "phone2": "0451-966-921",
          "email": "idella@hotmail.com",
          "web": "http://www.artesianicecoldstorageco.com.au"
        }
      ]
    }
  }
}
</script>

Data Binding

You should pass your data in JSON format to 'Items' property.

Titles

This is an optional option to show your own titles to header of the Gridvue. If you leave it empty Gridvue show the object keys in header please see the following exmaple:

this.titles = ['ID', 'First Name', 'Last Name']

Configuration

You can do some professional config please pay attention to following table:

ConfigDescriptionData TypeDefault Value
showTotalShow the total of itemsBooleantrue
theme.orientationShow Vertical or Horizontal tableString ('vertical'/ 'horizontal')'vertical'
theme.gridViewClassAdd additional class name to parent of html element to customization styleStringnull
paginate.statusShow paginate data rowsBooleantrue
paginate.perPageNumber of rows show in a pageInteger10
paginate.perPageSelectableUser can select how many numbers of rows must be shownBooleantrue
paginate.perPageValuesList of total numbers of rows they show to userArray5 ,10, 20, 50, 100
paginate.totalPageTotal of pagesIntegerCalculate
paginate.totalTotal numbers of rowsIntegerCalculate
paginate.currentPageActive pageInteger1
filter.statusFilter data and order themBooleantrue
filter.orderBy.fieldField that you wanna order data dependStringnull
filter.orderBy.orderingOrder dataString ('ASC'/'DESC')'ASC'
search.statusSearch in dataBooleantrue
search.placeholderPlaceholder for search inputStringSearch something...

Prefix of all the configs are "this.config." for example: this.config.search.status = true

Contact me

imanfava@gmail.com

0.1.91

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago