Finish task#3247 管理员可以自定义所有人用的列表的默认布局。,cost:5 left:0

This commit is contained in:
wangyidong
2017-10-18 16:53:33 +08:00
parent 5f0c90a923
commit fe16db7484
7 changed files with 67 additions and 28 deletions
+5 -2
View File
@@ -49,9 +49,12 @@ class datatableModel extends model
{
$datatableId = $module . ucfirst($this->app->getMethodName());
$mode = isset($this->config->datatable->$datatableId->mode) ? $this->config->datatable->$datatableId->mode : 'table';
$key = $mode == 'datatable' ? 'cols' : 'tablecols';
$module = zget($this->config->datatable->moduleAlias, $module, $module);
if(!isset($this->config->$module)) $this->loadModel($module);
if(isset($this->config->datatable->$datatableId->cols)) $setting = json_decode($this->config->datatable->$datatableId->cols);
if(isset($this->config->datatable->$datatableId->$key)) $setting = json_decode($this->config->datatable->$datatableId->$key);
$fieldList = $this->getFieldList($module);
if(empty($setting))
@@ -120,7 +123,7 @@ class datatableModel extends model
$id = $col->id;
if($col->show)
{
echo "<th data-flex='" . ($col->fixed == 'no' ? 'true': 'false') . "' data-width='{$col->width}' class='w-$id'>";
echo "<th data-flex='" . ($col->fixed == 'no' ? 'true': 'false') . "' data-width='{$col->width}' style='width:" . (is_numeric($col->width) ? "{$col->width}px" : $col->width) . "' class='w-$id'>";
if($id == 'actions')
{
echo $this->lang->actions;