diff --git a/examples/simple.php b/examples/simple.php index edf8606..09ec7a3 100644 --- a/examples/simple.php +++ b/examples/simple.php @@ -15,7 +15,7 @@ $table->columns([ 'description' => [ "format" => "html", "style" => ["width" => "300px"], - "filter" => ["input" => ["radio" => "hello", "bye"]], + "filter" => ["input" => ["radio" => ["hello", "bye"]]], "value" => function ($cell) { return "$cell"; } diff --git a/src/Filter/InputFilter.php b/src/Filter/InputFilter.php index 9275a6d..0b69f6d 100644 --- a/src/Filter/InputFilter.php +++ b/src/Filter/InputFilter.php @@ -13,7 +13,9 @@ class InputFilter extends Filter // $this->html = ""; //// var_dump(key($this->data)); // $key = key($this->data); -// foreach ($this->data as $value){ +// foreach ($this->data[$key] as $value){ +//// echo "
";
+////                print_r($value);
 //                $this->html .= "";
 //            }
 //            return $this->html . "";
diff --git a/src/JasonTable.php b/src/JasonTable.php
index ab979ed..fcf4e24 100644
--- a/src/JasonTable.php
+++ b/src/JasonTable.php
@@ -96,9 +96,9 @@ class JasonTable
         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;
-                    }
+//                    foreach ($this->beforePrintCell[$column]['filter'] as $key => $value) {
+                        return key($this->beforePrintCell[$column]['filter']);
+//                    }
                 }
             }
         }
@@ -110,9 +110,11 @@ class JasonTable
         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) {
-                        return $value;
-                    }
+//                    foreach ($this->beforePrintCell[$column]['filter'] as $value) {
+//                    echo "
";
+//                    print_r(current($this->beforePrintCell[$column]['filter']));
+                        return current($this->beforePrintCell[$column]['filter']);
+//                    }
                 }
             }
         }
diff --git a/src/ListJsonTable.php b/src/ListJsonTable.php
index 70d904a..2209028 100644
--- a/src/ListJsonTable.php
+++ b/src/ListJsonTable.php
@@ -269,12 +269,10 @@ class ListJsonTable extends JasonTable
         foreach ($columnKeys as $key){
             if ($this->issetFilter($key)){
 //                $this->html .= "";
-                $tag = $this->getTagFromCustomColumn($key);
-                $item = $this->getCurrentFilter($tag);
+                $item = $this->getCurrentFilter($this->getTagFromCustomColumn($key));
                 $objItem = new $item([
                     'data' => $this->getFilterFromCustomColumn($key),
                     'name' => $key
-//                    'value' => $this->getFilterFromCustomColumn($key)
                 ]);
                 $this->html .= $objItem->fetch();
             }