Vue good table demo

November 28, 11 min read Many companies use data tables to show complex reports. Some common use cases for table UIs include displaying data for finance reports, sports leaderboards, and pricing and comparison pages. UI-wise, data tables are one of the best options to show complex data in an organized way. Some of the UX challenges for tables include:. A table might need scrolling in both directions. Default browser scrollbars will work well for full-width tables, but most are of a custom width.

Custom scrollbars are very tricky to support on both touch and non-touch screens. Managing the width of the column based on data length is tricky.

Datatables with officeconnecttuneboss.online and Laravel - Server side

It often causes UX glitches when we load dynamic data in the table. Each time the data changes, it resizes the column width and causes an alignment glitch.

vue good table demo

We need to be careful in handling those issues while designing the UX. In this article, we will learn to build a simple Airtable clone using React. We will explore some of the open-source React table libraries and choose the best one for our use case.

It has more than 7k stars on GitHub, receives frequent updates, and supports Hooks. React table library is very lightweight and offers all the basic features necessary for any simple table.

It has nearly 4k GitHub stars and is well maintained. By default, react-data-grid supports longer table UIs and is optimized for performance, so pagination might not be necessary unless the UX demands it. It also uses Bootstrap for styling.

Best JavaScript Data Grids and Spreadsheets

Intermediate needs when you have to build a mini editable data table similar to Google Sheets or Airtable with nice UX. It has a similar number of GitHub stars and contributions and is likewise a well-maintained library. It primarily focuses on creating your own Google Sheets-like application. It has basic features inbuilt to create such UX-heavy applications. Once again, it might not be suitable for creating general-purpose page UI with tables.

Unlike react-data-grid, however, it is not optimized for large datasets, so use it for small applications that need Sheets-like functionality. It has only this one use case, and its features are very limited compared to those of react-data-grid. As the name itself implies, react-virtualized is heavily optimized for performance when the dataset is large. This library is not exactly a table library; it does much more.

It is exclusively for displaying large datasets on the UI in different formats, like grid, table, and list. For normal use cases, this library would be overkill, and the API would be too advanced. Use react-virtualized for custom timelines, charts involving infinitely long calendars, and heavy UI elements for your large dataset.Grid with filtering, editing, inserting, deleting, sorting and paging.

Data provided by controller. Read about controller interface in the docs. Simple grid with static data. Provide an array to option data in config. Controller loadData method requests data from OData service with ajax.

Any asynchronous source could be used instead. Just return jQuery. This demo shows how to implement editing and inserting data to the grid with external details dialog.

Here for popup we use jQuery UI dialog plugin. The jQuery Validation Plugin is used for form validation. Sorting can be done not only with column header interaction, but also with sort method. Grid supports field values validation for inserting and editing. There are plenty of built-in validators available. Furthermore custom validators can be easily added. Grid supports localization. Find how to set locale and register custom locale in the Localization section.

Grid allows to load data by pages. It helps to reduce data loading time and of course necessary for large data sources. All components of the grid can be easily configured. Heading, filtering, inserting, editing, sorting, paging and row selection could be switched with a single corresponding boolean option.

Grid rows can be completely customized. There are special row renderer functions. To customize data row use rowRenderer. Cell content of every column can be customized with itemTemplateheaderTemplatefilterTemplate and insertTemplate functions specified in field config.

This example shows how to implement batch deleting with custom field for selecting items.Earlier this week I was talking to a good friend of mine who is also a recent convert to the School of Vue and he was talking about the troubles he went through in adding table sorting and pagination to a table.

He was making use of a particular Vue component that was - to be nice - "undocumented". While I was reasonable certain that other solutions existed, I thought it would be fun to take a stab at writing my own support for table sorting and pagination. Not a generic solution, but just a solution for a particular set of data. I began with a Vue app that loaded in data via an Ajax call and rendered a table. This initial version has no sorting or pagination, it just loads data and dumps it in the view.

Here's the layout:. I've got a table with four columns: Name, Age, Breed, and Gender. And then I simply loop over my cats to render each row. The JavaScript is simple:.

As an aside, I say it's simple, but as always, if anything here doesn't make sense, just ask me in the comments below!

While it isn't too exciting, you can see this running below. Alright, so for the first update, I decided to add sorting. I made two changes to the view. First, I added click handlers to my headers so I could do sorting. Secondly, I switched my loop to use sortedCatswhich I'm going to set up as a Vue computed property.

Here's the new HTML:. On the JavaScript side, I had to do a few things. First, I added properties to keep track of what I was sorting by and in what direction:. Next, I added the sort method. It has to recognize when we are sorting by the same column and flip the direction:. I'm just using the sort method of my array with the property being dynamic. The modifier bit just handles reversing the numbers based on the direction of the sort. You can test this version below:.

Examples index

By the way, you'll notice some debug data at the bottom of the view. In a real application I'd remove that, but I used that as a handy way to track values while I was clicking. Almost there! For the final version I added pagination. I began by adding buttons to the front end for pagination:.

In the JavaScript I made the following changes. First, I added values to track the page size and current page:. Next, I added the prevPage and nextPage methods, which were pretty simple:.

Finally, I modified my computed property to check the page size and current page values when returning data. I did this via a filter call:. Note the creation of a start and end value. I almost always screw this up so I created variables instead of a super complex if statement. And here is that final version:.

So that's it.

vue good table demo

There is definitely room for improvement.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.

If nothing happens, download GitHub Desktop and try again. If nothing happens, download Xcode and try again. If nothing happens, download the GitHub extension for Visual Studio and try again. A simple, clean data table for VueJS 2. The plugin is meant to be used with existing Vue 2. It uses ES6 features so as long as your build process includes a transpiler, you're good to go. Note: vue-good-table also supports dynamic td templates where you dictate how to display the cells.

Vue-good-table allows providing your own css classes for the table via styleClass option but it also has in-built classes that you can make use of.

Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. A simple, clean data table for vuejs with essential features like sorting, column filtering, pagination etc. JavaScript Branch: master. Find file. Sign in Sign up. Go back. Launching Xcode If nothing happens, download Xcode and try again. This branch is commits behind xaksis:master.

Pull request Compare. Latest commit Fetching latest commit…. Vue-good-table A simple, clean data table for VueJS 2. Installing Install with npm: npm install --save vue-good-table import into project: import Vue from 'vue'; import VueGoodTable from 'vue-good-table'; Vue. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Allows a single search input for the whole table Note: enabling this filter disables column filters.

Text Options - for those interested in using other languages.Example format:. Example conversions:. These titles will be displayed in the table header, in the order they appear in the first record of data.

See the Fields section below for customizing how field headings appear. Note: Field order is not guaranteed. Fields will typically appear in the order they were defined in the first row, but this may not always be the case depending on the version of browser in use.

See section Fields column definitions below to see how to guarantee the order of fields, and to override the headings generated. Record data may also have additional special reserved name keys for colorizing rows and individual cells variantsand for triggering additional row detail.

The supported optional item record modifier properties make sure your field keys do not conflict with these names :. Provider functions can also be asynchronous:. See the "Using Items Provider functions" section below for more details. The fields prop is used to customize the table columns headings, and in which order the columns of data are displayed. The field object keys i. Fields can be provided as a simple array or an array of objects. Internally the fields data will be normalized into the array of objects format.

Events or slots that include the column field data will be in the normalized field object format array of objects for fieldsor an object for an individual field. Fields can be a simple array, for defining the order of the columns, and which columns to display:.

Example: Using array fields definition. Fields can be a an array of objects, providing additional control over the fields such as sorting, formatting, etc. Only columns keys that appear in the fields array will be shown:.

For information and usage about scoped slots and formatters, refer to the Custom Data Rendering section below. The value specified by the primary column key must be either a string or numberand must be unique across all rows in the table.

If you are seeing rendering issue i. Specifying the primary-key column is handy if you are using 3rd party table transitions or drag and drop plugins, as they rely on having a consistent and unique per row :key value.

Refer to the Table body transition support section for additional details. Note: table style options fixedstackedcaption-topno-border-collapsesticky headers, sticky columns, and the table sorting feature, all require BootstrapVue's custom CSS. You can also style every row using the tbody-tr-class prop, and optionally supply additional attributes via the tbody-tr-attr prop:.Merge Cells.

Conditional Formatting. Context Menu. Dropdown Menu. Multi Column Sorting. Export to CSV. Basic calculations. Nested Headers. Collapsible Columns. Trim Rows. Adds rows or column headings to the spreadsheet. You can assign a letter to each column automatically, or enter your own custom name, and even HTML elements.

vue good table demo

Sorts data in ascending or descending order throughout selected columns. You can optionally add an arrow indicating the sorting order.

Creates a larger, single cell by merging multiple cells. It keeps the content of the upper-left cell and removes the content of all other cells. Allows manual modification of row or column sizes. The sizing handle appears in the right part of the column header or at the bottom of the row header. Allows manual swapping of rows or columns within the table. The moving handle appears in the left part of the column header or at the top of the row header.

Defines how the specific cells are formatted depending on the content. For instance, in this demo all negative values are marked red and the positive values are green. Opens a pop-up menu that provides a list of items to choose.

Right-click anywhere inside the table to open the context menu. Allows the addition of criteria to display only specific rows while hiding others. Available from the dropdown menu in the header. Sorts data in ascending or descending order throughout multiple columns.

Adds the ability to export the data as comma-separated values.GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. If nothing happens, download GitHub Desktop and try again. If nothing happens, download Xcode and try again. If nothing happens, download the GitHub extension for Visual Studio and try again. An easy to use, clean and powerful data table for VueJS with essential features like sorting, column filtering, pagination and much more - xaksis.

Did vue-good-table just save you a bunch of time? Use some of them extra minutes to spread the joy! Hey there! Skip to content. Dismiss Join GitHub today GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together. Sign up. Vue Branch: master. Find file. Sign in Sign up. Go back. Launching Xcode If nothing happens, download Xcode and try again. Latest commit. TheJaredWilcurt Add link to live demo for collapsable rows Latest commit 80df56f Apr 3, Vue-good-table An easy to use, clean and powerful data table for VueJS with essential features like sorting, column filtering, pagination and much more - xaksis.

Installing Install with npm: npm install --save vue-good-table. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window.


comments

Leave a Reply

Your email address will not be published. Required fields are marked *