* Format dtable fields.

This commit is contained in:
sunguangming
2023-06-13 16:03:02 +08:00
parent 142220cfcc
commit 3e93bc4d4e
2 changed files with 2 additions and 12 deletions
+1 -1
View File
@@ -94,7 +94,7 @@ class datatable extends control
}
$name = 'datatable.' . $module . ucfirst($method) . '.cols';
$value = json_encode(array_values($fieldList));
$value = json_encode($fieldList);
$this->loadModel('setting')->setItem($account . '.' . $name, $value);
if($this->post->global) $this->setting->setItem('system.' . $name, $value);
+1 -11
View File
@@ -109,17 +109,7 @@ class datatableModel extends model
}
}
usort($setting, array('datatableModel', 'sortCols'));
/* In index array, find actions. */
$types = array_column($setting, 'type');
$index = array_search('actions', $types);
if($index)
{
$setting['actions'] = $setting[$index];
unset($setting[$index]);
}
uasort($setting, array('datatableModel', 'sortCols'));
return $setting;
}