A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.laravel-enso.com/frontend/tables below:

Website Navigation


Tables | Laravel Enso

# Tables

DataTable Vue Components with a Bulma implementation over a renderless core

Can be used outside of the Enso ecosystem.

For live examples and demos, you may visit laravel-enso.com

Should be used with its backend sibling

# Installation

Install the package:

(within Enso, remember to cd into the client folder before installing front-end assets)

Note that this package has a couple of external dependencies. Read here for more info.

# Exports

@enso-ui/tables/bulma:

@enso-ui/tables/renderless:

# Usage # Outside of Enso

Import the following in a main js file:

Then in any given page import the component:

And then use it within your page:

# Within Enso

Enso comes with a series of defaults and conventions, and there are Enso specific versions of some components that make use of these conventions so you add as little as possible configuration.

Import the Enso version of the component:

Use the component in your page:

If you're following conventions, the table component will try to determine the endpoint's path by using the current page's path as well as assuming the path's suffix will be initTable.

Of course, you can still manually specify and thus overwrite this determined path:

There's also the route() helper available, so instead of the above you can also use it in combination with named routes:

# Usage Details # CoreTable

This is the renderless version of the component that can be built upon to create your own custom version.

# Props # Events:

Various other user events may be emitted depending on the configured template.

# VueTable

This is the main bulma styled component and it is built upon the renderless component renderless/VueTable.vue.

# Example: # Props

All the props from CoreTable can be provided here

# Slots # EnsoTable

Is designed to be used within the Enso ecosystem, requiring minimal configuration from the dev.

Example:

# Props

All the props from VueTable can be provided here

# Slots

The custom slots from VueTable are available here

# Filtering and Sorting # Sorting

In order for a column to be sortable, it needs to be marked in the template as such ('sortable');

Once the columns are configured as searchable, when you want to sort using a certain column, it is enough to click the column's header.

Once a sorting has been applied, there will be a small 'x' button visible which you can use to cancel the sorting.

You may also use the reset button to clear all the table customizations including sorting and reload the template.

# Filtering

In order to filter using a string of text, you may start typing in the search input.

All columns marked in the template as 'searchable' (even those marked as 'notVisible' or 'rogue') will be used for filtering. The search type is WHERE ... OR ....

For a brief example the following string abc will be used as search value. By default, there are five search modes available:

Also, the default search mode is to look for attributes starting with the searched text as it's faster than 'full' and more useful than 'exactMatch'.

In the interface, if you want to switch between the search modes, you can use the button that appears to the right side of the search input, once you've typed something.

The button can show a maximum of three characters. To indicate the mode you're in, it will display either 3 letters of whatever you've typed or 1-2 letters, replacing the remaining space with asterisk wildcard (*). Ex: if the search word is "abc", the button will be illustrated like: "ab*", "*ab", "abc" "*a*", "abc".

The search filter is case-insensitive.

The available modes as well as the default mode can be customized in the tables config.

Once the mode has been changed in the interface, the preferences are saved in the browser's local storage.

If you want to remove the search filtering, clear the search input.

You may also use the reset button to clear all the table customizations including searching and reload the template.

# Advanced Filtering

Beyond the automatic filtering available out of the box, the VueJS component takes a set parameters which you can use on the back-end to customize the query:

Intervals are meant for applying date/dateTime restrictions on your results, are applied automatically and should respect table and column names:

Please take a look at the CoreTable parameters section above for more information on the value of dateFormat.

Filters are meant for applying generic restrictions on your results, are applied automatically and should also respect table and column names:

Params are meant for building custom logic restrictions on your results and are NOT applied automatically. As such the parameter structure and attribute names depend on your choices.

The parameters object will be made available in your table builder specific methods. Please be sure to read the advanced usage section of the documentation for more information.

# Table Init Sample Response

Below is the response from the back-end when the table is initialized. The sample is taken from the https://www.laravel-enso.com/system/menus/ index page.

# Table Data Sample Response

Below is the response given by the backend when searching for something via the search input.

# Questions & Issues

For questions and support please use the issues functionality for this package's github repository.

Please make sure to search for existing issues before creating a new issue, and when opening a new issue, fill the required information in the issue template.

Issues not conforming to the guidelines may be closed immediately.

# Contributions

are welcome. Pull requests are great, but issues are good too.

Thank you to all the people who already contributed to Enso!

# License

ISC


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4