filter class

This commit is contained in:
2024-08-23 14:52:22 +03:00
parent 77a306a0f6
commit b4dc2f6ab1
8 changed files with 118 additions and 59 deletions

View File

@ -14,14 +14,12 @@
"perPage": "5",
"currentPage": "1",
"showActionColumn": true,
"showFiltersRow": true,
"filter": true,
"total": 10,
"paginationPrefix": "/page",
"params": {"class": "table table-bordered", "border": "1"}
},
"filters": [
"email"
],
"data": [
{"id": 1,"email":"fas1@mail.ru","description":"sdgsdfg","description2":"ffdghdas", "created_at": "17.06.2024", "status": "1"},
{"id": 2,"email":"fas2@mail.ru","description":"fafdgdfgsdfdfs","description2":"ffdghdas", "created_at": "18.06.2024", "status": "1"},

View File

@ -10,18 +10,22 @@ $table = new ListJsonTable($json);
$table->columns([
"created_at" => [
"format" => "date:Y-m-d",
'filter' => "date"
'filter' => ["input" => "date"]
],
'description' => [
"format" => "html",
"style" => ["width" => "300px"],
"filter" => "text",
"filter" => ["input" => ["radio" => "hello", "bye"]],
"value" => function ($cell) {
return "<span style='color: sienna'>$cell</span>";
}
],
'description2' => [
"filter" => ["input" => "text"],
],
'status' => [
"format" => "integer",
"filter" => ["select" => getStatusLabel()],
"value" => function ($cell) {
return getStatusLabel()[$cell];
}],