All Projects → zhjing1019 → Complexgrid

zhjing1019 / Complexgrid

复杂表格,支持表格展示,树形表格展示,对表格进行拖拽排序,以及表格排序,表格拖拽排序,自定义表格内容,是一个基于vue的表格插件。Complex table, support table display, tree table display, drag and drop table sort, and table sort, table drag and drop sort, custom table content, is a vue based table plugin

Labels

Projects that are alternatives of or similar to Complexgrid

Kingtable
Library for administrative tables that are able to build themselves, on the basis of the input data.
Stars: ✭ 60 (-45.45%)
Mutual labels:  table
Material Ui Table Edit
Material UI Table Edit
Stars: ✭ 93 (-15.45%)
Mutual labels:  table
Angular Generic Table
A generic table for Angular 2+. Generic table uses standard markup for tables ie. table, tr and td elements etc. and has support for expanding rows, global search, filters, sorting, pagination, export to CSV, column clicks, custom column rendering, custom export values.
Stars: ✭ 100 (-9.09%)
Mutual labels:  table
Angular Responsive Tables
Make your HTML tables look great on every device
Stars: ✭ 69 (-37.27%)
Mutual labels:  table
Texreg
Conversion of R Regression Output to LaTeX or HTML Tables
Stars: ✭ 85 (-22.73%)
Mutual labels:  table
React Virtualized Pivot
React Virtualized Pivot
Stars: ✭ 95 (-13.64%)
Mutual labels:  table
React Grid Table
A modular table, based on a CSS grid layout, optimized for customization.
Stars: ✭ 57 (-48.18%)
Mutual labels:  table
Ax5ui Grid
Javascript UI Component - GRID ( Excel Grid, jqGrid, angularjs grid, jquery grid, SlickGrid, ag-grid gridify)
Stars: ✭ 102 (-7.27%)
Mutual labels:  table
Tksheet
Python 3.6+ tkinter table widget for displaying tabular data
Stars: ✭ 86 (-21.82%)
Mutual labels:  table
Gridviewscroll
Freeze column and fixed header in Table or GridView
Stars: ✭ 99 (-10%)
Mutual labels:  table
Floatthead
Fixed <thead>. Doesn't need any custom css/html. Does what position:sticky can't
Stars: ✭ 1,193 (+984.55%)
Mutual labels:  table
Tailwindcss Tables
Bootstrap styled tables for Tailwind CSS
Stars: ✭ 84 (-23.64%)
Mutual labels:  table
V2 Table
A simple table component based Vue 2.x: https://dwqs.github.io/v2-table/
Stars: ✭ 96 (-12.73%)
Mutual labels:  table
React Ant Pro
(基于pro 1.0)基于Ant Design Pro 后台项目修改的多标签页tabs(多标签tabs、拖拽、富文本、多功能table、多选Select、React Hooks)
Stars: ✭ 64 (-41.82%)
Mutual labels:  table
Laravel Table
Generate tables from Eloquent models.
Stars: ✭ 101 (-8.18%)
Mutual labels:  table
Bootstraptable Treeview
bootstrapTable extension of treeView
Stars: ✭ 57 (-48.18%)
Mutual labels:  table
Basictable
Basic Table jQuery or Vanilla JS plugin for simple responsive tables.
Stars: ✭ 94 (-14.55%)
Mutual labels:  table
Vue Table Dynamic
🎉 A dynamic table with sorting, filtering, editing, pagination, multiple select, etc.
Stars: ✭ 106 (-3.64%)
Mutual labels:  table
Quilljs Table
Table functionality for quilljs
Stars: ✭ 101 (-8.18%)
Mutual labels:  table
Vim Table Mode
VIM Table Mode for instant table creation.
Stars: ✭ 1,341 (+1119.09%)
Mutual labels:  table

grid

正常的表格展示
树形结构的表格展示
表格进行拖拽排序
自定义表格内容
拖拽表格数据
多级表头展示

install dependencies 下载依赖包

npm install

serve with hot reload at localhost:8080 启动项目

npm run dev

拖拽树形表格

图片名称

拖拽正常表格

图片名称

树形表格自定义表格内容

图片名称

多表头表格展示

图片名称

数据为空表格展示

图片名称

正常表格展示

图片名称

组件的使用

下载组件

npm install complex-grid

引用组件

在main.js里引用组件

import ComplexGrid from "complex-grid"
Vue.use(ComplexGrid)

组件的用法

<complex-grid
      ref="treeGrid1"
      :fields="treeGridJson.fields"
      :data.sync="treeGridJson.data"
      :checkable="true"
      :isTree="true"
      :empty="empty"
      style="height: 300px"
      @clickFirst="testClick"
      @dragStart="dragstart"
      @dragEnd="dragendTree"
      @checkboxClick="checkboxClick"
      @checkAllClick="checkAllClick"
      :loadState="loadState"
      :isDrag="true"
      :isExpandAll="true"
    >
</complex-grid>

表格属性

fields代表表头字段
data代表数据
checkable可选择
isTree是否为树形结构表格,默认false
empty表格为空时所展示的图片
loadState 表格状态( 0,表示加载数据成功。1,表示加载数据失败。2,表示没有可加载的数据。3,表示不用异步加载数据)
isDrag 表示是否可以拖拽
isExpandAll 表示是否全部展开

表格方法

clickFirst表格第一列被点击后的事件
dragStart开始拖拽时的事件(返回当前被拖拽的数据)
dragEnd拖拽结束后的事件(返回三个参数,开始被拖拽的数据,拖拽结束后的数据,拖拽后的位置)

如果可以拖拽,调用组件里的isQueryDrag方法,即可拿到拖拽后重新排列的数据

dragend (startval, endval, whereInsert) {
      let newData = this.$refs.treeGrid1.isQueryDrag(startval, endval, whereInsert)
      this.treeGrid1.data = [...newData]
    },
checkboxClick 复选框被选中事件
checkAllClick 表格被全选事件

组件调用事件

console.log(this.$refs[ref].selectRow) 表示选中行的数据
this.$refs[ref].isQueryDrag(startval, endval, whereInsert) 表示确定拖拽
this.$refs[ref].resetSumGridStyle () 重置表格
this.$refs[ref].makeTreeExpand(id, isExpand) 展开或收起某一行数据(id为树的节点id,isExpand为Boolean值,true为展开,false为收起)。

fields表头字段

{
      id: 'JGQC',
      title: '测试',
      linkable: true,
      width: 300
    },

    {
      id: 'JGJC',
      title: '测试',
      sortable: true,
      width: 190
    },
    {
      id: 'JGFZR',
      title: '测试',
      width: 150
    },
    
  ],

第一列特殊

第一列linkable:表头可点击
第一列slot:表头操作按钮部分自定义
width: 宽度

其他列

sortable:是否排序
slot:是否自定义
width: 宽度

树形结构数据

每行数据需要有id, children代表子节点数据

  data: [
    {
      id: 11111,
      JGQC: '二级2222222',
      JGJC: 'true',
      JGFZR: 'test',
      ZGJG: '总本部',
      JGLB: 'test',
      JGZT: 'test',
      JGSX: 'test',
      JGCJ: 'test',
      BZRS: '40',
      SYRS: '39',

      children: [
        {
          id: 22222,
          JGQC: '二级2222222',
          JGJC: 'true',
          JGFZR: 'test',
          ZGJG: '总本部',
          JGLB: 'test',
          JGZT: 'test',
          JGSX: 'test',
          JGCJ: 'test',
          BZRS: '40',
          SYRS: '39',

          children: [
            {
              id: 33333,
              JGQC: '二级2222222',
              JGJC: 'true',
              JGFZR: 'test',
              ZGJG: '总本部',
              JGLB: 'test',
              JGZT: 'test',
              JGSX: 'test',
              JGCJ: 'test',
              BZRS: '40',
              SYRS: '39'

            }
          ]
        },
        {
          id: 44444,
          JGQC: '二级2222222',
          JGJC: 'true',
          JGFZR: 'test',
          ZGJG: '总本部',
          JGLB: 'test',
          JGZT: 'test',
          JGSX: 'test',
          JGCJ: 'test',
          BZRS: '40',
          SYRS: '39'
        }
      ]
    },
    {
      id: 55555,
      JGQC: '翻页后的数据',
      JGJC: 'true',
      JGFZR: 'test',
      ZGJG: '总本部',
      JGLB: 'test',
      JGZT: 'test',
      JGSX: 'test',
      JGCJ: 'test',
      BZRS: '40',
      SYRS: '39'
    },
    {
      id: 66666,
      JGQC: '翻页后的数据',
      JGJC: 'true',
      JGFZR: 'test',
      ZGJG: '总本部',
      JGLB: 'test',
      JGZT: 'test',
      JGSX: 'test',
      JGCJ: 'test',
      BZRS: '40',
      SYRS: '39'
    },
  ],

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].