Преглед на файлове

表头过滤器选中时样式

jqh преди 5 години
родител
ревизия
a30eea91bf
променени са 3 файла, в които са добавени 6 реда и са изтрити 3 реда
  1. 2 1
      src/Grid/Column/Filter.php
  2. 2 2
      src/Grid/Column/Filter/Equal.php
  3. 2 0
      src/Grid/Column/Filter/Input.php

+ 2 - 1
src/Grid/Column/Filter.php

@@ -121,9 +121,10 @@ abstract class Filter implements Renderable
 
     /**
      * @param array ...$params
+     *
      * @return static
      */
-    public static function create(...$params)
+    public static function make(...$params)
     {
         return new static(...$params);
     }

+ 2 - 2
src/Grid/Column/Filter/Equal.php

@@ -52,9 +52,9 @@ class Equal extends Filter
      *
      * @return $this
      */
-    public function datetime()
+    public function datetime(string $format = 'YYYY-MM-DD HH:mm:ss')
     {
-        return $this->setDateFormat('YYYY-MM-DD HH:mm:ss');
+        return $this->setDateFormat($format);
     }
 
     /**

+ 2 - 0
src/Grid/Column/Filter/Input.php

@@ -40,6 +40,8 @@ JS;
     {
         $this->addScript();
 
+        $value = $this->getFilterValue();
+
         $active = empty($value) ? '' : 'text-yellow';
 
         return <<<EOT