* Add custom cols of execution-all.
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
<?php foreach ($cols as $key => $col):?>
|
||||
<?php
|
||||
$required = $col['required'] == 'yes';
|
||||
$fixed = $col['fixed'];
|
||||
$fixed = !empty($col['fixed']) ? $col['fixed'] : 'no';
|
||||
$autoWidth = $col['width'] == 'auto';
|
||||
?>
|
||||
<div class='clearfix col<?php echo ($required ? ' require' : '') . (' fixed-' . $fixed) ?>' data-key='<?php echo $key?>' data-fixed='<?php echo $fixed?>' data-width='<?php echo $col['width']?>'>
|
||||
|
||||
@@ -44,3 +44,5 @@ canvas {height: 28px;}
|
||||
.table thead .c-left.text-right {padding-right: 8px;}
|
||||
#executionsForm td.c-name {padding-right: 5px;}
|
||||
#executionsForm td.c-name.delay {padding-right: 55px;}
|
||||
#myTable .dtable-header, #executionsForm .dtable-rows {z-index: 4;}
|
||||
#executionsForm .table-header .btn-toolbar {background: rgb(241, 245, 249);}
|
||||
|
||||
@@ -5165,13 +5165,12 @@ class executionModel extends model
|
||||
{
|
||||
$this->loadModel('datatable');
|
||||
|
||||
$setting = '';
|
||||
if(isset($this->config->datatable->executionAll->cols)) $setting = json_decode($this->config->datatable->executionAll->cols);
|
||||
$setting = $this->datatable->getSetting('execution');
|
||||
|
||||
$fieldList = $this->config->execution->datatable->fieldList;
|
||||
|
||||
foreach($fieldList as $field => $items)
|
||||
{
|
||||
{
|
||||
$title = zget($this->lang->execution, $items['title'], zget($this->lang, $items['title'], $items['title']));
|
||||
$fieldList[$field]['title'] = $title;
|
||||
}
|
||||
@@ -5207,9 +5206,30 @@ class executionModel extends model
|
||||
{
|
||||
foreach($setting as $key => $set)
|
||||
{
|
||||
if(empty($set->show))
|
||||
{
|
||||
unset($setting[$key]);
|
||||
continue;
|
||||
}
|
||||
|
||||
if($set->id == 'actions') $set->width = $fieldList[$set->id]['width'];
|
||||
|
||||
$set->name = $set->id;
|
||||
$set->title = $fieldList[$set->id]['title'];
|
||||
if(isset($fieldList[$id]['sortType'])) $set->sortType = $fieldList[$id]['sortType'];
|
||||
|
||||
if(isset($fieldList[$set->id]['checkbox'])) $set->nestedToggle = $fieldList[$set->id]['checkbox'];
|
||||
if(isset($fieldList[$set->id]['nestedToggle'])) $set->nestedToggle = $fieldList[$set->id]['nestedToggle'];
|
||||
if(isset($fieldList[$set->id]['fixed'])) $set->fixed = $fieldList[$set->id]['fixed'];
|
||||
if(isset($fieldList[$set->id]['width'])) $set->width = $fieldList[$set->id]['width'];
|
||||
if(isset($fieldList[$set->id]['type'])) $set->type = $fieldList[$set->id]['type'];
|
||||
if(isset($fieldList[$set->id]['sortType'])) $set->sortType = $fieldList[$set->id]['sortType'];
|
||||
if(isset($fieldList[$set->id]['flex'])) $set->flex = $fieldList[$set->id]['flex'];
|
||||
if(isset($fieldList[$set->id]['minWidth'])) $set->minWidth = $fieldList[$set->id]['minWidth'];
|
||||
if(isset($fieldList[$set->id]['maxWidth'])) $set->maxWidth = $fieldList[$set->id]['maxWidth'];
|
||||
if(isset($fieldList[$set->id]['pri'])) $set->pri = $fieldList[$set->id]['pri'];
|
||||
|
||||
unset($set->id);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/datatable.fix.html.php';?>
|
||||
<?php
|
||||
js::import($jsRoot . 'dtable/min.js');
|
||||
css::import($jsRoot . 'dtable/min.css');
|
||||
@@ -76,6 +77,9 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
|
||||
</div>
|
||||
<?php else:?>
|
||||
<form class='main-table' id='executionsForm' method='post' action='<?php echo inLink('batchEdit');?>'>
|
||||
<div class="table-header fixed-right">
|
||||
<nav class="btn-toolbar pull-right setting"></nav>
|
||||
</div>
|
||||
<div id="myTable"></div>
|
||||
<div class='table-footer'>
|
||||
<?php $pager->show('right', 'pagerjs');?>
|
||||
@@ -84,14 +88,16 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
|
||||
<script>
|
||||
cols = JSON.parse(cols);
|
||||
data = JSON.parse(data);
|
||||
var width = $('.table-footer').width() + parseFloat($('.table-footer').css('padding-right')) + 5;
|
||||
const options = {
|
||||
height: 'auto',
|
||||
width: width,
|
||||
striped: true,
|
||||
plugins: ['nested'],
|
||||
cols: cols,
|
||||
data: data,
|
||||
};
|
||||
|
||||
|
||||
$('#myTable').dtable(options);
|
||||
</script>
|
||||
<?php endif;?>
|
||||
|
||||
Reference in New Issue
Block a user