2017 © Pedro Peláez
 

library vue-datatable

Bootstrap Table with vue js.

image

sagaryonjan/vue-datatable

Bootstrap Table with vue js.

  • Sunday, April 1, 2018
  • by sagaryonjan
  • Repository
  • 2 Watchers
  • 10 Stars
  • 45 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 6 Forks
  • 1 Open issues
  • 6 Versions
  • 15 % Grown

The README.md

Laravel Vue Js Datatable.

The sagaryonjan/vue-datatable package provides easy to create table with vue js. It makes easy to customize your table., (*1)

Installation

You can install the package via composer:, (*2)

``` bash composer require sagaryonjan/vue-datatable, (*3)


You can publish the migration with: ```bash php artisan vendor:publish --tag="vue-datatable"

Register Vue-datable in resources app.js ``` bash Vue.component('data-table', require('./components/datatable/DataTable.vue'));, (*4)



Create Datatable Controller. ``` bash php artisan datatable:controller CategoryController App\Model\Category

View Table ``` bash renderDatable($data), (*5)


Pagination Limit ``` bash public $pagination = 20;

Show Quick Search default false ``` bash protected $quick_search = true;, (*6)


Display column ``` bash public $displayColumn = [ 'name', 'email', 'full_name', 'profession', 'status', 'action', ];

Rename Column ``` bash public $displayColumn = [ 'name' => 'Name', 'email' => 'Email', 'full_name' => 'Full Name', 'profession' => 'Profession', 'status' => 'Status', 'action' => 'Action', ];, (*7)


Customizing Table Let status field be boolean if you want to show your status active or inactive instead of boolean add this function to your datatable controller ``` bash public function status($value) { if($value->status == 1) return "<span class='label label-info'>Active</span>"; else return "<span class='label label-warning'>Warning</span>"; }

Using join, (*8)

``` bash public function query() {, (*9)

    $this->query = $this->builder
                        ->select(
                            'users.name',
                            'users.email',
                            'users.status',
                            'user_details.full_name',
                            'user_details.profession'
                        )
                        ->leftjoin(
                            'user_details',
                            'user_details.user_id',
                            '=',
                            'users.id'
                        );
}

Quick Search filter for join ``` bash public $quick_search_filter = ['users.name', 'users.email'];

Adding Action Column, (*10)

``` bash public function addColumn() {, (*11)

    $this->add_column = [
        "action" =>[
            'edit' => [
                "a" =>[
                    'href'      => [ 'route' => 'admin.user.edit', 'param' => ['id'] ],
                    'title'     => 'Edit',
                    'class'     => 'hero starter massive',
                    'id'        => 'stranger-{id}',
                    'data-attr' => 'mistake-{id}'
                ],
                "i" => [ 'class' => 'glyphicon glyphicon-edit'],
            ],

            'delete' => [
                "a" =>[
                    'href'      => [ 'route' => 'admin.user.delete', 'param' => ['id'] ],
                    'title'     => 'Edit',
                    'class'     => 'hero starter massive',
                    'id'        => 'stranger-{id}-{slug}',
                    'data-attr' => 'mistake-{id}'
                ],
                "i" => [ 'class' => 'glyphicon glyphicon-trash']
            ]
        ],
    ];
}

```, (*12)

License

The MIT License (MIT). Please see License File for more information., (*13)

The Versions

01/04 2018

dev-master

9999999-dev https://github.com/sagaryonjan/vue-datatable

Bootstrap Table with vue js.

  Sources   Download

MIT

The Requires

 

by Sagar Yonjan

laravel table vue resources data-table data-route

01/04 2018

1.0.3

1.0.3.0 https://github.com/sagaryonjan/vue-datatable

Bootstrap Table with vue js.

  Sources   Download

MIT

The Requires

 

by Sagar Yonjan

laravel table vue resources data-table data-route

19/03 2018

dev-issue-fixes

dev-issue-fixes https://github.com/sagaryonjan/vue-datatable

Bootstrap Table with vue js.

  Sources   Download

MIT

The Requires

 

by Sagar Yonjan

laravel table vue resources data-table data-route

19/03 2018

1.0.2

1.0.2.0 https://github.com/sagaryonjan/vue-datatable

Bootstrap Table with vue js.

  Sources   Download

MIT

The Requires

 

by Sagar Yonjan

laravel table vue resources data-table data-route

31/10 2017

1.0.1

1.0.1.0 https://github.com/sagaryonjan/vue-datatable

Bootstrap Table with vue js.

  Sources   Download

MIT

The Requires

 

by Sagar Yonjan

laravel table vue resources data-table data-route

02/10 2017

1.0.0

1.0.0.0 https://github.com/sagaryonjan/vue-datatable

Bootstrap Table with vue js.

  Sources   Download

MIT

The Requires

 

by Sagar Yonjan

laravel table vue resources data-table data-route