GithubHelp home page GithubHelp logo

njleonzhang / vue-data-tables Goto Github PK

View Code? Open in Web Editor NEW
1.0K 28.0 223.0 3.66 MB

A simple, customizable and pageable table with SSR support, based on vue2 and element-ui

Home Page: https://njleonzhang.github.io/vue-data-tables

License: MIT License

JavaScript 86.93% Vue 11.73% HTML 0.21% Shell 0.96% SCSS 0.17%
vue table datatables datatable

vue-data-tables's Introduction

Build Status Coverage Status Node badgesize download

Documentation

Dev

  • install dependencies
yarn install
  • serve test/play with hot reload at localhost:8081
npm run dev

My projects related to Vue

Buy me a coffee

vue-data-tables's People

Contributors

andrewharvey avatar cotsog avatar dependabot[bot] avatar ent47 avatar freezingriver avatar isme2n avatar isnifer avatar jaumebalust avatar jaxelr avatar jprando avatar kimond avatar lochstar avatar nezhar avatar njleonzhang avatar nosnaj avatar rajagopalx avatar rochefort avatar sallyruthstruik avatar sobolevn avatar storkyeh avatar yangyuqi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-data-tables's Issues

Sorting error

If i want to short my table, i get this warning to the console:

[Vue warn]: You may have an infinite update loop in a component render function.
(found in component )

I checked your demo, and the 1st table do the same, the others don't.

filter-method el-table-column

Hi ,

I use "filter-method" and "filters" attributes on "el-table-column" component with pagination on my table.
Can I filter on ALL rows ( all the pages) instead of rows on the current page ?

Indeed filter-method is called only for rows on the current page...

Thanks

Not able to add any options

If I try to add any options to datatable. I get this error:
Uncaught DOMException: Failed to execute 'setAttribute' on 'Element': ',' is not a valid attribute name.

This does not work. I get the above error:

<template>
    <data-tables :data='tableData',
                 :has-action-col='false'>

This works:

<template>
    <data-tables :data='tableData'>

Like I said I am not able to add any options at all.

Thanks for this excellent component.

support server side?

I base on Meteor.
I have problem with a big data that I get from Mongo.
Support server side or a big data?

Support Element UI Tables component attributes

I just want to use row status class via :row-class-name attribute but it's not supported in on <data-tables> element but works with <el-table>.

So, I think there is no supported <el-table> attributes at all.

Problem searching on every column

Hello!

I installed your module and I'm using it on vue2. I was able to add the table and fill it with data, but I can't seem to make the search work. In the documentation says that the default value of props is All which I assume means it searches on every column? If that's the case, it's not working for me.

I tried passing an array with my column props but it's not working either. Right now I have

<data-tables
	:data='table.rows'
	:search-def='{ placeholder: "Search..." }'
	action-col-width='50'
	action-col-label='Actions'>

	<el-table-column 
		v-for="column in table.columns" 
		:prop="column.id"
		:label="column.label"
		:sortable="column.sortable || true">
	</el-table-column>
</data-tables>

And my table object looks like this:

{
	columns: [
		{
			id: 'name',
			label: 'Brand name'
		},
		{
			id: 'modules',
			label: 'Active modules',
			sortable: false
		},
		{
			id: 'employees',
			label: 'Employees'
		}
	],
	rows: [
		{
			id: 1,
			name: 'Starbucks',
			modules: '[2,3,4]',
			employees: 20
		},
		{
			id: 2,
			name: 'Reebook',
			modules: '[1]',
			employees: 5
		},
		{
			id: 3,
			name: 'Havanna',
			modules: '[2,3]',
			employees: 100
		}
	]
}

But when I search, nothing happens and nothing gets filtered. No error on console either :(
Thanks for your time and hope you can help me out here!

Problem with `Meteor + Vue-Meteor`.

I base on Meteor + Vue-Meteor.
Get warning

"!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-739f43f1!../../node_modules/sass-loader/index.js!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./DataTables.vue"
in /Users/theara/Desktop/meteor-app/vue-element/node_modules/vue-data-tables/dist/data-tables.js (web.browser)

"!!../../node_modules/css-loader/index.js!../../node_modules/vue-loader/lib/style-rewriter.js?id=data-v-5ef578ba!../../node_modules/sass-loader/index.js!../../node_modules/vue-loader/lib/selector.js?type=styles&index=0!./ScCheckboxGroup.vue"
in /Users/theara/Desktop/meteor-app/vue-element/node_modules/vue-data-tables/dist/data-tables.js (web.browser)

If you notice problems related to these missing modules, consider running:

  meteor npm install --save !!..

=> Started your app.

=> App running at: http://localhost:3000/

But it work fine

Table row hover - CSS issue

On every 2nd row hover, the background didn't change, because the default color's css selector is stronger.

This will override:
.el-table--striped .el-table__body tr:nth-child(2n) td { background: #FAFAFA; }

this:
.el-table--enable-row-hover tr:hover>td { background-color: #eef1f6; }

Possible solution:
.el-table--enable-row-hover .el-table__body tr:hover>td { background-color: #eef1f6; }

JSBin

Hi @njleonzhang

I have a problem with vue-data-tables. To demonstrate my issue I wanted to create a JS Bin.
Did I do something wrong or isn't it possible to use vue-data-tables without module bundler?

sort-method is not call

I had el-table-column with sort-method works fine in el-table,
after moved into data-tables it's not called.

checkbox-filter-def: 来定义选择过滤的控件

这个控件,是否存在一个bug?
例子中是写死的,如果我要异步拉取选项会怎样?
通过试验,写死的可以出现这个控件,但是异步之后没有任何显示
问题原因:checkbox-filter-def属性的变化没有让组件更新,这个属性的逻辑处理是否写在mounted钩子里?
如果是,这可能是问题出现的原因,可以使用深度的watch的再次执行该属性的逻辑

Optionally disable pagination

Hi, thanks for the awesome component!

I would like to disable pagination in some cases. I would really like to have something like has-pagination property.

Would you mind a PR from me with this feature?

`<el-table-column>`width属性

不知道大佬发现没有,<el-table-column>width属性有BUG,无论设置什么值,都会变的很大,不知道是不是我使用的方式不对?

Chinese language showing on my table

I have successfully render my table but there are chinese characters on it. Please how can I remove them

Context

This is occurring at the level of pagination

在el-table-column 中使用 :formatter='dateFormater' 的问题

我在el-table-column 中用了

:formatter='dateFormater'

去转换时间的显示格式,
我发现search box会用el-table-columnprop的值(e.g. 2017-07-14T09:17:18.824Z) 作为搜索条件, 而不是用转换後的值(e.g. 2017-07-14 05:17 PM )
请问这个问题可以怎样解决?

谢谢?

Custom col template

How can I modify the output of data in a column?

Example 1: I'm getting a url from the API and I would like make it a full working link:
<a href="url from api">something</a>

Example 2: I receive the first name and last name as seperate values. I would like to join them to first name + last name and display them in one column

unable to figure out how to do a v-if on each table row

Sorry putting this in issues. Didn't find where to ask for this help.
I'm using lib on my project a couldn't figure how to do something.
Please how do a v-if so it will show a row on depending a condition. I have look a your get start but couldn't find a solution. please can you just give a link jsfiddle.
Thanks. close this only if you have a solution to it.

Sort by default

Can I use the element's "default-sort" property in a data-tables?

如何获得所选单元格?限定操作按钮的显示,点击"添加"后在最后一列

感谢你的贡献,data-tables很美观,目前看起来也很好用。
我在使用中遇到点问题,希望能帮我解答下
如题
1、我想在点击某单元格时能通过触发方法,获取该单元格内容,或者说将该单元格修改为input 状态,该如何办到?
2、在某些情况下,我并不想action-col内的按钮显示,我该如何操作?
3、点击某个按钮之后,能否在table最下方或者最上方添加一行均为input 单元格的内容列?

Data Table doesn't refresh after update

Hi guy,

First , thanks for your work , it is very good.
I have one problem with data table when I update a row in the table.

My "data table" is a getter object in vuex and when I use the mutation "UPDATE_TABLE" to update one row in the data table object , the table render does not take into account the update.
I checked my data Table and it is well updated.

After update, Curiously , when I click on filters on my table, the table render take into account the update.

Can you see this ?

Thank you.

个别属性为何不使用计算属性

在使用中遇到一些问题,由于我有一些数据也是动态算出来的,请问一下比如 innerCheckboxFilterDef 这个属性为什么不改用计算属性,而在created 的时候就定义好?

`row-action-def` should be a function

I want to set different actions to different rows based on the data in the row.
But right now it seems impossible to me.

Any ideas on how to achieve that?

Search placeholder

Please, make it possible to pass a placeholder to the search input item. Something like this for example:

      getSearchDef() {
        return {
          offset: 12,
          placeholder: 'my placeholder text',
          props: ['title', 'author'], // can be string or Array
        };
      },

Set total count of tableData

Hello, how can I set ":total" value for pagination. In the src pagination total is computed value, but is there any way to change it?

thx =)

建议能设置操作按钮type属性

  1. 建议能够设置el-button内的type属性,而不是单一的只有text类型
  2. 建议能设置"操作"列的fixed属性,实际操作中"操作"列应该第一眼给用户看到

请问怎么自定义下拉菜单过滤器

image
请问有没有例子或者详细一点的文档介绍自定义过滤器,我想定义两个下拉菜单过滤器 请问该怎么写,急需,麻烦解答一下,谢谢

支持远程筛选吗

比如,从别的地方,传过来一个 {value:'未解决'},我想将value这个字段,作为表格的筛选条件,有接口可以调用吗? 麻烦啦

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.