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 = "
"; +//// print_r($value); // $this->html .= ""; // } // return $this->html . "
"; +// 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(); }