2 Commits
1.0.9 ... 1.1.1

Author SHA1 Message Date
d7e9e06925 fix filter submit button 2024-12-23 15:24:15 +03:00
b7927bf3c8 add action column to filter with submit button 2024-12-19 16:53:57 +03:00

View File

@ -73,8 +73,8 @@ class ListJsonTable extends JasonTable
}
if ($this->showFiltersRow) {
$this->getFilters($columnKeys);
$this->html .= "</thead>";
}
$this->html .= "</thead>";
}
public function createTbody(): void
@ -271,8 +271,10 @@ class ListJsonTable extends JasonTable
private function getFilters(array $columnKeys): void
{
$this->html .= "<tr><form action='$this->baseUrl/search'>";
$flag = false;
foreach ($columnKeys as $key) {
if ($this->issetFilter($key)) {
$flag = true;
$filter = $this->getCurrentFilter($key);
$params = [
'param' => $filter['param'] ?? '',
@ -290,8 +292,9 @@ class ListJsonTable extends JasonTable
$this->html .= "<td></td>";
}
}
if ($this->showActionColumn) {
$this->html .= "<td></td>";
if ($flag) {
$this->showActionColumn = true;
$this->html .= "<td><input class='btn btn-primary' type='submit' style='width: 150px' value='Применить'></td>";
}
$this->html .= "</form></tr>";
}