Commit 6432fea3 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'S6690-subrecords-tablesorter' into 'master'

Support #6690 Tablesorter for subrecords / refs #6690

See merge request !91
parents 31d0fb76 41cabe9d
Pipeline #903 passed with stage
in 1 minute and 48 seconds
......@@ -3330,7 +3330,11 @@ will be rendered inside the form as a HTML table.
* *Constant '&'*: Indicate a 'constant' value. E.g. `&12:xId` or `{{...}}` (all possibilities, incl. further SELECT
statements) might be used.
* *subrecordTableClass*: Optional. Default: 'table table-hover qfq-table-100'. If given, the default will be overwritten.
* *subrecordTableClass*: Optional. Default: 'table table-hover qfq-subrecord-table'. If given, the default will be overwritten.
This parameter is helpful if you want to add tablesorting to your subrecord - example: ::
subrecordTableClass = table table-hover qfq-subrecord-table tablesorter tablesorter-pager
* *subrecordColumnTitleEdit*: Optional. Will be rendered as the column title for the new/edit column.
* *subrecordColumnTitleDelete*: Optional. Will be rendered as the column title for the delete column.
......@@ -6802,7 +6806,7 @@ For additional customization there are the following options:
* You can pass in a default configuration object for the main `tablesorter()` function by using the attribute
`data-tablesorter-config` on the table.
Use JSON syntax when passing in your own configuration, such as:
Use JSON syntax when passing in your own configuration, such as: ::
data-tablesorter-config='{"theme":"bootstrap","widthFixed":true,"headerTemplate":"{content} {icon}","dateFormat":"ddmmyyyy","widgets":["uitheme","filter","saveSort","columnSelector"],"widgetOptions":{"filter_columnFilters":true,"filter_reset":".reset","filter_cssFilter":"form-control","columnSelector_mediaquery":false} }'
......
......@@ -2406,7 +2406,7 @@ abstract class AbstractBuildForm {
}
if ($flagDelete) {
$columns .= "<th>$deleteTitle</th>";
$columns .= "<th data-sorter='false' class='filter-false' data-priority='always'>$deleteTitle</th>";
}
return Support::wrapTag('<thead><tr>', $columns);
......@@ -2461,7 +2461,7 @@ abstract class AbstractBuildForm {
$editColumnTitle .= ' ' . $formElement[SUBRECORD_COLUMN_TITLE_EDIT];
if ($flagNew || $flagEdit) {
$linkNew = Support::wrapTag('<th>', $editColumnTitle);
$linkNew = Support::wrapTag('<th data-sorter="false" class="filter-false" data-priority="always">', $editColumnTitle);
}
}
......
......@@ -793,7 +793,7 @@ const SUBRECORD_COLUMN_ROW_CLASS = '_rowClass';
const SUBRECORD_COLUMN_ROW_TITLE = '_rowTitle';
const SUBRECORD_COLUMN_ROW_TOOLTIP = '_rowTooltip';
const SUBRECORD_TABLE_CLASS_DEFAULT = 'table table-hover qfq-table-100 qfq-subrecord-table';
const SUBRECORD_TABLE_CLASS_DEFAULT = 'table table-hover qfq-subrecord-table';
const GLYPH_ICON = 'glyphicon';
const GLYPH_ICON_EDIT = 'glyphicon-pencil';
......
......@@ -37,11 +37,11 @@ $(document).ready( function () {
$(this).tablesorter(tablesorterConfig);
if (hasColumnSelector) {
var columnSelectorHtml = '<button id="' + columnSelectorId + '" class="btn btn-default qfq-column-selector" ' +
'type="button" style="float:right;">' +
var columnSelectorHtml = '<div class="qfq-column-selector-wrapper"><button id="' + columnSelectorId + '" class="btn btn-default qfq-column-selector" ' +
'type="button">' +
'<span class="dropdown-text"><span class="icon glyphicon glyphicon-th-list"></span></span>' +
'<span class="caret"></span></button>' +
'<div class="hidden"><div id="' + columnSelectorTargetId + '" class="qfq-column-selector-target"> </div></div>';
'<div class="hidden"><div id="' + columnSelectorTargetId + '" class="qfq-column-selector-target"> </div></div></div>';
$(columnSelectorHtml).insertBefore($(this));
$.tablesorter.columnSelector.attachTo($(this), '#' + columnSelectorTargetId);
$('#' + columnSelectorId).popover({
......
......@@ -147,7 +147,9 @@ select.qfq-locked:invalid {
}
.qfq-subrecord-table {
margin-top: 0;
margin-top: -5px;
min-width: 100%;
width: auto;
}
.qfq-form-title {
......
......@@ -342,6 +342,15 @@ td.tablesorter-pager{background-color:#e6eeee;margin:0}
input.tablesorter-filter.disabled {
display:none;
}
.qfq-column-selector-wrapper {
width: 100%;
position: relative;
}
.qfq-column-selector {
position: absolute;
top: -35px;
right: 0;
}
.qfq-column-selector span.caret {
margin-left:5px;
}
......@@ -353,4 +362,4 @@ input.tablesorter-filter.disabled {
}
.qfq-column-selector-target .disabled {
color: #ddd;
}
}
\ No newline at end of file
Supports Markdown
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