This commit is contained in:
Kavalar 2024-08-29 11:36:44 +03:00
parent 0960a7b1fd
commit c816a7f14b
2 changed files with 0 additions and 47 deletions

View File

@ -91,33 +91,4 @@ class JasonTable
return $styleStr; return $styleStr;
} }
// protected function getTagFromCustomColumn(string $column): string
// {
// if (is_array($this->beforePrintCell[$column])) {
// if (isset($this->beforePrintCell[$column]['filter'])) {
// if (is_array($this->beforePrintCell[$column]['filter'])) {
//// foreach ($this->beforePrintCell[$column]['filter'] as $key => $value) {
// return key($this->beforePrintCell[$column]['filter']);
//// }
// }
// }
// }
// return "text";
// }
//
// protected function getFilterFromCustomColumn(string $column)
// {
// if (is_array($this->beforePrintCell[$column])) {
// if (isset($this->beforePrintCell[$column]['filter'])) {
// if (is_array($this->beforePrintCell[$column]['filter'])) {
//// foreach ($this->beforePrintCell[$column]['filter'] as $value) {
//// echo "<pre>";
//// print_r(current($this->beforePrintCell[$column]['filter']));
// return current($this->beforePrintCell[$column]['filter']);
//// }
// }
// }
// }
// return "text";
// }
} }

View File

@ -6,8 +6,6 @@ use Exception;
use Itguild\Tables\ActionColumn\DeleteActionColumn; use Itguild\Tables\ActionColumn\DeleteActionColumn;
use Itguild\Tables\ActionColumn\EditActionColumn; use Itguild\Tables\ActionColumn\EditActionColumn;
use Itguild\Tables\ActionColumn\ViewActionColumn; use Itguild\Tables\ActionColumn\ViewActionColumn;
use Itguild\Tables\Filter\InputFilter;
use Itguild\Tables\Filter\SelectFilter;
use Itguild\Tables\traits\CreateParams; use Itguild\Tables\traits\CreateParams;
use JetBrains\PhpStorm\NoReturn; use JetBrains\PhpStorm\NoReturn;
@ -72,9 +70,6 @@ class ListJsonTable extends JasonTable
if ($this->showActionColumn) { if ($this->showActionColumn) {
$this->html .= "<th>Действия</th></th></tr>"; $this->html .= "<th>Действия</th></th></tr>";
} }
// if ($this->filters) {
// $this->getFilters($columnKeys);
// }
if($this->showFiltersRow){ if($this->showFiltersRow){
$this->getFilters($columnKeys); $this->getFilters($columnKeys);
$this->html .= "</thead>"; $this->html .= "</thead>";
@ -149,11 +144,6 @@ class ListJsonTable extends JasonTable
private function getCurrentFilter(string $column) private function getCurrentFilter(string $column)
{ {
// return match ($filter) {
// 'input' => InputFilter::class,
// 'select' => SelectFilter::class,
// default => false,
// };
if (is_array($this->beforePrintCell[$column])) { if (is_array($this->beforePrintCell[$column])) {
if (isset($this->beforePrintCell[$column]['filter'])) { if (isset($this->beforePrintCell[$column]['filter'])) {
if (is_array($this->beforePrintCell[$column]['filter'])) { if (is_array($this->beforePrintCell[$column]['filter'])) {
@ -276,13 +266,6 @@ class ListJsonTable extends JasonTable
$this->html .= "<tr><form action='$this->baseUrl/search'>"; $this->html .= "<tr><form action='$this->baseUrl/search'>";
foreach ($columnKeys as $key){ foreach ($columnKeys as $key){
if ($this->issetFilter($key)){ if ($this->issetFilter($key)){
// $this->html .= "<td><input type='" . $this->getFilterFromCustomColumn($key) . "' name='$key'></td>";
// $item = $this->getCurrentFilter($this->getTagFromCustomColumn($key));
// $objItem = new $item([
// 'data' => $this->getFilterFromCustomColumn($key),
// 'name' => $key
// ]);
// $this->html .= $objItem->fetch();
$filter = $this->getCurrentFilter($key); $filter = $this->getCurrentFilter($key);
$class = new $filter['class']([ $class = new $filter['class']([
'param' => $filter['param'], 'param' => $filter['param'],
@ -304,7 +287,6 @@ class ListJsonTable extends JasonTable
public function create(): void public function create(): void
{ {
$this->setActions(); $this->setActions();
// $this->setFilters();
$this->beginTable(); $this->beginTable();
$this->createThead(); $this->createThead();
$this->createTbody(); $this->createTbody();