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

parent 27f4c3c9
...@@ -72,6 +72,10 @@ ...@@ -72,6 +72,10 @@
margin-right: 30px; margin-right: 30px;
} }
input[type="checkbox"]
{
vertical-align: -2px;
}
.form-group .form-control .form-group .form-control
{ {
...@@ -142,3 +146,32 @@ ...@@ -142,3 +146,32 @@
margin-top: 30px; 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(){ ...@@ -44,6 +44,14 @@ $(document).ready(function(){
renderLineChart(); renderLineChart();
renderHourTable(); 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 // Отрисовка графика Stat
function renderLineChart() function renderLineChart()
{ {
......
...@@ -142,14 +142,17 @@ $dates = $this->dates; ...@@ -142,14 +142,17 @@ $dates = $this->dates;
<div class="b-content__loading"></div> <div class="b-content__loading"></div>
<table id="table-line" class="table table-striped admin"> <table id="table-line" class="table table-striped admin">
<thead class="metric sortable"> <thead class="metric sortable">
<tr data-metric="<?= $metric ?>" <?= $current_style ?>> <tr data-metric="<?= $metric ?>">
<th><?= _t('Дата/Компания')?></th> <th><?= _t('Дата/Компания')?></th>
<?php foreach(['shows', 'clicks', 'transactions', 'salemoney', 'admoney'] as $name): ?> <?php foreach(['shows', 'clicks', 'transactions', 'salemoney', 'admoney'] as $name): ?>
<th> <th>
<input type="checkbox" />
<b id="<?= $name ?>"> <b id="<?= $name ?>">
<?= _t($name)?> <?= _t($name)?>
<!--
<b class="arrow asc">&and;</b> <b class="arrow asc">&and;</b>
<b class="arrow desc">&or;</b> <b class="arrow desc">&or;</b>
-->
</b> </b>
</th> </th>
<?php endforeach ?> <?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