laravel-enso / tables

Bulma themed, VueJS powered Datatable with server-side loading and JSON template setup
https://www.laravel-enso.com/examples/table
632 stars 77 forks source link

How add global button #54

Closed shonhor22 closed 6 years ago

shonhor22 commented 6 years ago

This is a help request.

Description

how add global button that delete filtered datatable value

Steps to Reproduce

Expected behavior

additional button that pass all datatable value id to controller

Actual behavior

aocneanu commented 6 years ago

This is not possible now, but in the near future we will have the option to add global buttons that can "do" a custom action on all the filtered entries.

aocneanu commented 6 years ago

@shonhor22, soon we will have a docs update with the steps needed for adding a custom action for a chunk (selection) of models from a table. This way you can implement a mass delete, or anything else needed.

Stay tuned :)

@gandesc please update the docs.

gandesc commented 6 years ago

@shonhor22 Hi, please take a look at the documentation here on how to add action buttons

shonhor22 commented 6 years ago

when click added delete button following error

[2018-04-14 13:23:24] local.ERROR: json_decode() expects parameter 1 to be string, array given {"userId":2,"email":"shonhor22@gmail.com","exception":"[object] (ErrorException(code: 0): json_decode() expects parameter 1 to be string, array given at /Users/shonkhor/Documents/workspace/enso/vendor/laravel-enso/vuedatatable/src/app/Classes/Table/Filters.php:54) [stacktrace]

aocneanu commented 6 years ago

Composer update

shonhor22 commented 6 years ago

Same error after composer update. When \Log::info($this->request->get('filters'); return following array. [2018-04-14 17:53:50] local.INFO: array ( 't_barilga' => array ( 'is_active' => NULL, 'is_imported' => NULL, 'ashiglaagui_tuluv_id' => array ( ), ), 't_hayag' => array ( 'aimag_id' => array ( ), 'bus_id' => array ( ), 'sum_duureg_id' => array ( ), 'bag_horoo_id' => array ( ), 'horoolol_id' => array ( ), 'hothon_id' => array ( ), 'bairshil' => NULL, ), )

aocneanu commented 6 years ago

I just pushed a fix. Please update to v1.1.5 (run composer update again)

shonhor22 commented 6 years ago

now error changed to

[2018-04-14 18:41:00] local.ERROR: Trying to get property of non-object {"userId":2,"email":"shonhor22@gmail.com","exception":"[object] (ErrorException(code: 0): Trying to get property of non-object at /Users/shonkhor/Documents/workspace/enso/vendor/laravel-enso/vuedatatable/src/app/Classes/Table/Filters.php:37)

when print $column it return array non object

aocneanu commented 6 years ago

fixed, go for v1.1.6

shonhor22 commented 6 years ago

[2018-04-15 12:06:07] local.ERROR: Trying to get property of non-object {"userId":2,"email":"shonhor22@gmail.com","exception":"[object] (ErrorException(code: 0): Trying to get property of non-object at /Users/shonkhor/Documents/workspace/enso/vendor/laravel-enso/vuedatatable/src/app/Classes/Table/Filters.php:89)