All Projects → MicroDroid → Vue Materialize Datatable

MicroDroid / Vue Materialize Datatable

Licence: mit
A fancy Materialize CSS datatable VueJS component.

Projects that are alternatives of or similar to Vue Materialize Datatable

Bootstrap Table
An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation, Vue.js)
Stars: ✭ 11,068 (+6732.1%)
Mutual labels:  material-design, table, vuejs2
Watermelondb
🍉 Reactive & asynchronous database for powerful React and React Native apps ⚡️
Stars: ✭ 7,996 (+4835.8%)
Mutual labels:  hacktoberfest, reactive, database
Tech Refrigerator
🍰 기술 냉장고입니다. 🛒 기술 면접 , 전공 시험 , 지식 함양 등 분명 도움될 거예요! 🤟
Stars: ✭ 699 (+331.48%)
Mutual labels:  hacktoberfest, data-structures, database
Sdb
Simple and fast string based key-value database with support for arrays and json
Stars: ✭ 159 (-1.85%)
Mutual labels:  hacktoberfest, data-structures, database
Ultimate Java Resources
Java programming. All in one Java Resource for learning. Updated every day and up to date. All Algorithms and DS along with Development in Java. Beginner to Advanced. Join the Discord link.
Stars: ✭ 143 (-11.73%)
Mutual labels:  hacktoberfest, data-structures
Vue Pure Lightbox
Very simple lightbox plugin (without any dependencies) for Vuejs 🌅
Stars: ✭ 142 (-12.35%)
Mutual labels:  hacktoberfest, vuejs2
Vue Smart Table
A simple table component for interactive tables built with Vue.js
Stars: ✭ 145 (-10.49%)
Mutual labels:  material-design, table
Pygm
🐍 Python library implementing sorted containers with state-of-the-art query performance and compressed memory usage
Stars: ✭ 156 (-3.7%)
Mutual labels:  data-structures, database
Angular Filemanager
JavaScript File Manager Material Design Folder Explorer Navigator Browser Manager in AngularJS with CSS3 Responsive (with FTP in PHP / Java / Node)
Stars: ✭ 1,693 (+945.06%)
Mutual labels:  hacktoberfest, material-design
Materialdrawer
The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.
Stars: ✭ 11,498 (+6997.53%)
Mutual labels:  hacktoberfest, material-design
Comfy Table
🔶 Build beautiful terminal tables with automatic content wrapping
Stars: ✭ 156 (-3.7%)
Mutual labels:  hacktoberfest, table
R2dbc Pool
Connection Pooling for Reactive Relational Database Connectivity
Stars: ✭ 141 (-12.96%)
Mutual labels:  reactive, database
Interviews
A list of fancy questions I've been asked during the interviews I had. Some of them I ask when interviewing people.
Stars: ✭ 140 (-13.58%)
Mutual labels:  data-structures, database
Jupyter
Stars: ✭ 145 (-10.49%)
Mutual labels:  hacktoberfest, data-structures
Reduxmoviedb
🎥 See the upcoming movies! ReSwift + RxSwift 💖 Hacktoberfest 🎃
Stars: ✭ 137 (-15.43%)
Mutual labels:  hacktoberfest, reactive
Vue Ui For Pc
基于Vue2.x的一套PC端UI组件,包括了Carousel 跑马灯、Cascader 级联、Checkbox 多选框、Collapse 折叠面板、DatePicker 日期选择、Dialog 对话框、Form 表单、Input 输入框、InputNumber 数字输入框、Layer 弹窗层、Loading 加载、Menu 菜单、Page 分页、Progress 进度条、Radio 单选框、SelectDropDown 仿select、Switch 开关、Table 表格、Tabs 标签页、Textarea 文本框、Tooltip 文字提示、BackTop 返回顶部、steps 步骤条、Transfer 穿梭框、Tree 树形、Upload 文件上传、Lazy 图片懒加载、Loading 加载、Pagination 分页等等
Stars: ✭ 156 (-3.7%)
Mutual labels:  table, vuejs2
C Plus Plus
Collection of various algorithms in mathematics, machine learning, computer science and physics implemented in C++ for educational purposes.
Stars: ✭ 17,151 (+10487.04%)
Mutual labels:  hacktoberfest, data-structures
Akka
Build highly concurrent, distributed, and resilient message-driven applications on the JVM
Stars: ✭ 11,938 (+7269.14%)
Mutual labels:  hacktoberfest, reactive
Playframework
Play Framework
Stars: ✭ 12,041 (+7332.72%)
Mutual labels:  hacktoberfest, reactive
Torchbear
🔥🐻 The Speakeasy Scripting Engine Which Combines Speed, Safety, and Simplicity
Stars: ✭ 128 (-20.99%)
Mutual labels:  hacktoberfest, database

vue-materialize-datatable NPM version

A fancy Materialize CSS datatable VueJS component

BTC donations: 16dt5DdjGvduZ3KZcFrwsBA82qqfrcbeUQ

Screenshot

Demo

https://microdroid.github.io/vue-materialize-datatable/

Features

  • Sorting, with numerical sorting
  • Pagination
  • Localization
  • Fuzzy searching
  • Server searching
  • Excel export
  • Printing
  • Custom topbar buttons
  • Flexible data-from-row extractor
  • Follows the Material Design spec
  • Really, really efficient.. handles thousands of rows flawlessly
  • And much more..

Requirements

Installation

npm i vue-materialize-datatable --save

You also need to include Material Design icons. You have two ways of doing this:

The first and the recommended way is loading via Google's CDN, by adding this tag to your HTML

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Or this in your CSS/Sass files:

@import url(http://fonts.googleapis.com/icon?family=Material+Icons);

Alternatively, you can use the NPM package and add the font to your bundle by:

npm i material-design-icons-iconfont -S

and then include it in your Sass/CSS files

@import "~material-design-icons-iconfont/dist/material-design-icons";

Usage

Include the component,

import DataTable from "vue-materialize-datatable";

Then, register the component, however you like:

{
    ...
    components: {
        ...
        "datatable": DataTable
    }
}

And then.. use the component:

<datatable></datatable>

Of course, code above will render garbage. Here are the props it accepts to render some sensible data:

Prop name Description Example
title The title of the datatable
"Todos" // Name in top 
      
columns Columns
        
[ // Array of objects 
  {    
    label: "Name", // Column name
    field: "name", // Field name from row
                   // Use dot for nested props
                   // Can be function with row as 1st param
    numeric: false,// Affects sorting
    html: false    // Escapes output if false.
  } 
];
          
      
rows Rows
        
[ // Array of objects 
  {    
    name: 'test', // Whatever
    ...
  } 
];
          
      
perPage Numbers of rows per page
[10, 20, 30, 40, 50] (default) // Results per page
      
defaultPerPage Default rows per page
10 (default) // Default results per page, otherwise it will be the
first value of perPage
      
initSortCol Default column for sorting on component initialization
-1 (default) // By default table is not sorted by any column
      
onClick Function to execute on click
console.log('hey') // Function, row 1st param
      
clickable Clickable rows. Will fire row-click event
true (default) // Row is passed in the event payload
      
sortable Cause column-click to sort
true (default) // Whether sortable
      
searchable Add fuzzy search functionality
true (default) // Whether searchable
      
exactSearch Disable fuzzy search
true (default) // Whether only exact matches are returned
      
serverSearch Server search is used to fetch data from server
false (default) // If you wanna do server search then searchable and
serverSearch must be true and use serverSearchFunc as callback.
      
serverSearchFunc Function for search search
function // For this searchSearch criteria is must.
      
paginate Add footer next/prev. buttons
true (default) // Whether paginated
      
exportable Add button to export to Excel
true (default) // Whether exportable
      
printable Add printing functionality
true (default) // Whether printable
      
customButtons Custom buttons thingy
        
// Array of objects
[
  { 
    hide: false, // Whether to hide the button
    icon: "search", // Materialize icon 
    onclick: aFunc() // Click handler 
  } 
];
        
      

Localization

You can use the property locale to set the display language. Available languages:

  • en (English, default)
  • ar (Arabic)
  • es (Spanish)
  • cat (Catalan)
  • br (Brazilian Portuguese)
  • nl (Netherlands)
  • fr (French)
  • de (German)

You can very easily contribute a locale. Just clone locales/en.json and require in locales/index.js

React to click on row

The datatable will emit the row-click event if clickable is set to true (default).

The events payload will contain the row object, you can bind to the event like this:

<datatable v-on:row-click="onRowClick"></datatable>

<script>
  var app = new Vue({
    el: '#app',
    ...
    methods: {
      onRowClick: function (row) {
        //row contains the clicked object from `rows`
        console.log(row)
      }
    },
  })
</script>
...

Rows per page

You can specify the options of rows per page with the perPage prop. The first value will be the default value and the array will be sorted, so you can put whatever number you want.

<!-- The default value will be 100 -->
<datatable :perPage="[100, 10, 25, 50, 500]"></datatable>

The options will be rendered as [10, 20, 50, 100, 500]

Rows per page

Otherwise, you can specify the default rows per page with the defaultPerPage prop.

<!-- The default value will be 100 -->
<datatable :perPage="[10, 25, 50, 100, 500]" :defaultPerPage="100"></datatable>

Row buttons

Alright actually this is a hack. We probably should've implemented actual support for this but for now, here's an example on how to achieve something similar to the screenshot above:

<datatable title="News" ...>
  <th slot="thead-tr">
    Actions
  </th>
  <template slot="tbody-tr" scope="props">
    <td>
      <button class="btn red darken-2 waves-effect waves-light compact-btn"
          @click="(e) => deleteItem(props.row, e)">
        <i class="material-icons white-text">delete</i>
      </button>
    </td>
  </template>
</datatable>

Feel free to copy paste the code above, heh.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].