This commit is contained in:
pbao9
2026-02-07 17:50:36 +07:00
parent 2a6a5d2131
commit e9f2218030
10 changed files with 601 additions and 245 deletions
+15 -1
View File
@@ -11,15 +11,29 @@ class DataTable extends Component
public string $id;
public string $ajax;
public array $columns;
public ?string $bulkDeleteUrl;
public function __construct(
string $id,
string $ajax,
array $columns
array $columns,
?string $bulkDeleteUrl = null
) {
$this->id = $id;
$this->ajax = $ajax;
$this->columns = $columns;
$this->bulkDeleteUrl = $bulkDeleteUrl;
if ($this->bulkDeleteUrl) {
array_unshift($this->columns, [
'key' => 'checkbox',
'label' => '<div class="form-check d-flex align-items-center justify-content-center"><input class="form-check-input" type="checkbox" id="dt-master-checkbox"></div>',
'orderable' => false,
'searchable' => false,
'className' => 'text-center align-middle',
'width' => '30px'
]);
}
}
/**