Добавил checkbox И сортировки для колонок табл.

parent 27f4c3c9
......@@ -72,6 +72,10 @@
margin-right: 30px;
}
input[type="checkbox"]
{
vertical-align: -2px;
}
.form-group .form-control
{
......@@ -142,3 +146,32 @@
margin-top: 30px;
}
.table.table-striped.admin thead.metric.sortable tr b
{
cursor: pointer;
}
.table.table-striped.admin thead.metric.sortable tr b.selected
{
color: #2CA02C;
}
/*
.table.table-striped.admin thead.metric tr b .arrow
{
display: none;
}
.table.table-striped.admin thead.metric.sortable tr b.selected .arrow.asc,
.table.table-striped.admin thead.metric.sortable tr b.selected.desc .arrow.desc
{
display: inline;
}
.table.table-striped.admin thead.metric.sortable tr b.selected .arrow.desc,
.table.table-striped.admin thead.metric.sortable tr b.selected.desc .arrow.asc
{
display: none;
}
*/
\ No newline at end of file
......@@ -44,6 +44,14 @@ $(document).ready(function(){
renderLineChart();
renderHourTable();
// Сортировка по колонкам внутри таблицы:
$('#table-line').on('click', 'thead.metric.sortable th b', function(){
$('#table-line thead.metric.sortable th b').removeClass('selected');
$(this).addClass('selected');
$(this).toggleClass('desc');
renderHourTable();
});
// Отрисовка графика Stat
function renderLineChart()
{
......
......@@ -142,14 +142,17 @@ $dates = $this->dates;
<div class="b-content__loading"></div>
<table id="table-line" class="table table-striped admin">
<thead class="metric sortable">
<tr data-metric="<?= $metric ?>" <?= $current_style ?>>
<tr data-metric="<?= $metric ?>">
<th><?= _t('Дата/Компания')?></th>
<?php foreach(['shows', 'clicks', 'transactions', 'salemoney', 'admoney'] as $name): ?>
<th>
<input type="checkbox" />
<b id="<?= $name ?>">
<?= _t($name)?>
<!--
<b class="arrow asc">&and;</b>
<b class="arrow desc">&or;</b>
-->
</b>
</th>
<?php endforeach ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment