1.1.1 • Published 3 years ago

jl-datatable v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

capture

🚀 There is an online demo:

Front End 👉 Repository Github

Backend with Laravel 👉 Repository Github

Basic usage

<jl-datatable
    :url='http://localhost/api/users'
    :columns="[
        {
            label: 'ID',
            data: 'id'
        },   
        {
            label: 'Name',
            data: 'name' 
        },
        {
            label: 'Last Name',
            data: 'last_name'
        },    
    ]"  
/>

Installing

Install the JlDatatable package:

npm install jl-datatable
# or
yarn add jl-datatable

Register it as you usually would:

import {createApp } from 'vue'
import App from './App.vue'

import JlDatatable from 'jl-datatable'

const app = createApp(App)

app.component('jl-datatable', JlDatatable)

app.mount('#app')

Props - General

Property NameTypeRequiredDefault ValueDescription
urlStringYesNULLURL to get entries.
requestOptionsObjectNo{method: 'GET'}Allows to add more parameters in the request to be made to the server.
columnsArray ObjectYes[]An array of objects that specifies how to render each column.
pageLengthIntegerNo10Length of records shown in the table.
lengthMenuArray IntegerNo[10, 25, 50, 100]List of lengths for the menu to display in the table.
orderObjectNo{ column: 0, dir: 'ASC'}Sort the records, for sort you have two options of ascending (ASC) and descending (DESC) sorting.
resetStringNoNULLReset the data from the datatable. Only a random string different from the previous one should be sent.

Prop: columns

Property NameTypeRequiredDefault ValueDescription
labelStringYesNULLIs what is shown in the table header.
dataStringYesNULLAllows to identify the data to be obtained by means of key and value.
orderableBooleanNoTrueIf true, sorting is activated for the column.
searchableBooleanNoTrueIf true, the search for the column is activated.
componentObjectNoNULLAllows you to add a component, e.g. edit and delete buttons.

Events

NameReturnDescription
gettingEntriesObjectReturns the request to be made to the server.
entriesFetchedObjectReturns the request made to the server and the data.

License

MIT

1.1.1

3 years ago

1.1.0

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.14

4 years ago

0.1.13

4 years ago

0.1.12

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago