diff --git a/composer.json b/composer.json index 4a44b69..661121c 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "bower-asset/bootstrap": "~3.3.7", "bower-asset/bootstrap-table": "1.11.1", "demogorgorn/yii2-ajax-submit-button": "1.2.1", - "kayalshri/tableexport.jquery.plugin": "0.1.0", + "kayalshri/tableexport.jquery.plugin": "dev-hhurz-merge", "akottr/dragtable": "2.0.16", "kartik-v/yii2-date-range": "^1.6.9", "lavrentiev/yii2-toastr": "^2.0", diff --git a/src/Bundles/BootstrapTableExportAssetBundle.php b/src/Bundles/BootstrapTableExportAssetBundle.php index efb2dee..c15d800 100644 --- a/src/Bundles/BootstrapTableExportAssetBundle.php +++ b/src/Bundles/BootstrapTableExportAssetBundle.php @@ -9,16 +9,19 @@ class BootstrapTableExportAssetBundle extends AssetBundle /** * @var string */ - public $sourcePath = '@vendor/kayalshri/tableExport.jquery.plugin'; + public $sourcePath = '@vendor/hhurz/tableExport.jquery.plugin'; /** * @var array */ public $js = [ - 'tableExport.js', + 'libs/FileSaver/FileSaver.min.js', + 'libs/js-xlsx/xlsx.core.min.js', + 'libs/jspdf/jspdf.min.js', + 'libs/jsPDF-AutoTable/jspdf.plugin.autotable.js', + 'tableExport.js', 'jquery.base64.js', 'jspdf/libs/sprintf.js', - 'jspdf/jspdf.js', 'jspdf/libs/base64.js', ]; diff --git a/src/Components/Button.php b/src/Components/Button.php index 872f83c..4b040d7 100644 --- a/src/Components/Button.php +++ b/src/Components/Button.php @@ -49,7 +49,6 @@ public function run(): string return AjaxSubmitButton::widget($this->buttonConfig); } - // todo: does not work return LinkButton::widget($this->buttonConfig); } } diff --git a/src/Widgets/BootstrapTable.php b/src/Widgets/BootstrapTable.php index c06704f..51a9dec 100644 --- a/src/Widgets/BootstrapTable.php +++ b/src/Widgets/BootstrapTable.php @@ -13,6 +13,8 @@ class BootstrapTable extends GridView { /** + * @var array + * * see also: http://bootstrap-table.wenzhixin.net.cn/documentation/ for * additional table options */ @@ -43,6 +45,8 @@ class BootstrapTable extends GridView ]; /** + * @var array + * * see also: http://bootstrap-table.wenzhixin.net.cn/documentation/ for * additional column options. */ @@ -52,6 +56,9 @@ class BootstrapTable extends GridView 'data-switchable' => 'true', ]; + /** + * @var bool True to show a checkbox column + */ public $rowCheckboxSelect = true; /** @@ -88,7 +95,6 @@ public function run(): string public function renderTableHeader(): string { $html = []; - if ($this->rowCheckboxSelect) { $html[] = $this->addColumnCheckboxSelect(); } @@ -133,16 +139,14 @@ private function renderTableHeaderCell($cell): string private function setHeaderOptions($column) { $columnClass = (new ReflectionClass($column))->getShortName(); - switch ($columnClass) { - case 'ActionColumn': - $column->headerOptions = [ - 'data-field' => 'action', - 'data-filter-control' => 'false', - 'data-searchable' => 'false', - 'data-sortable' => 'false', - 'data-switchable' => 'false', - ]; - break; + if ('ActionColumn' === $columnClass) { + $column->headerOptions = [ + 'data-field' => 'action', + 'data-switchable' => 'false', + 'data-sortable' => 'false', + 'data-searchable' => 'false', + 'data-filter-control' => 'false', + ]; } $column->headerOptions = array_merge(