Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 6 additions & 3 deletions src/Bundles/BootstrapTableExportAssetBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];

Expand Down
1 change: 0 additions & 1 deletion src/Components/Button.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ public function run(): string
return AjaxSubmitButton::widget($this->buttonConfig);
}

// todo: does not work
return LinkButton::widget($this->buttonConfig);
}
}
26 changes: 15 additions & 11 deletions src/Widgets/BootstrapTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
class BootstrapTable extends GridView
{
/**
* @var array
*
* see also: http://bootstrap-table.wenzhixin.net.cn/documentation/ for
* additional table options
*/
Expand Down Expand Up @@ -43,6 +45,8 @@ class BootstrapTable extends GridView
];

/**
* @var array
*
* see also: http://bootstrap-table.wenzhixin.net.cn/documentation/ for
* additional column options.
*/
Expand All @@ -52,6 +56,9 @@ class BootstrapTable extends GridView
'data-switchable' => 'true',
];

/**
* @var bool True to show a checkbox column
*/
public $rowCheckboxSelect = true;

/**
Expand Down Expand Up @@ -88,7 +95,6 @@ public function run(): string
public function renderTableHeader(): string
{
$html = [];

if ($this->rowCheckboxSelect) {
$html[] = $this->addColumnCheckboxSelect();
}
Expand Down Expand Up @@ -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(
Expand Down