Parcourir la source

Merge pull request #608 from yurenzhen/2.0

增加健壮性, 以避免遇到json数组类型字段无法处理而报错 (#1)
Jiang Qinghua il y a 4 ans
Parent
commit
1c47b9124a
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      src/Grid/Tools/RowSelector.php

+ 2 - 1
src/Grid/Tools/RowSelector.php

@@ -64,7 +64,8 @@ HTML;
     public function renderColumn($row, $id)
     {
         $this->setupScript();
-        $title = e($this->getTitle($row, $id));
+        $title = $this->getTitle($row, $id);
+        $title = e(is_array($title) ? json_encode($title) : $title);
 
         return <<<EOT
 <div class="vs-checkbox-con vs-checkbox-{$this->style} checkbox-grid checkbox-grid-column">