* Support serach.

This commit is contained in:
Lufei
2022-10-20 13:58:18 +08:00
parent c53f1463ec
commit 3b4ff285e3
2 changed files with 12 additions and 1 deletions
+1
View File
@@ -75,6 +75,7 @@ foreach($programs as $program)
$rows[] = $row;
}
$table->search($status, $moduleName);
$table->data($rows);
$content = block();
+11 -1
View File
@@ -31,6 +31,8 @@ class dtable
{
public $cols = array();
public $search = '';
public function __construct($text = '')
{
$this->text = $text;
@@ -48,9 +50,17 @@ class dtable
$this->data = $data;
}
public function search($status, $module)
{
$this->search = '<div class="cell' . ($status == 'bySearch' ? " show" : "") . '" id="queryBox" data-module="' . $module . '"></div>';
return $this;
}
public function toString()
{
$html = '<div class="dtable"></div>';
$html = '';
if(!empty($this->search)) $html .= $this->search;
$html .= '<div class="dtable"></div>';
$html .= '<script>new zui.DTable(".dtable", {plugins: ["nested", "rich"], cols: ' . json_encode($this->cols) . ', data: ' . json_encode($this->data) . '})</script>';
return $html;