Commit aa8cac92 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'F13679_subrecord_tablesorter_view_saver' into 'develop'

S13679 Multiple changes in php and js to get tablesorter-view-saver work in...

See merge request !417
parents b6866fa0 a3a3f3ba
Pipeline #7093 passed with stage
in 1 minute and 48 seconds
......@@ -1048,6 +1048,7 @@ FormElement.parameter
| extraDeleteForm, | |
| detail, | |
| subrecordTableClass, | |
| subrecordTableAttribute | |
+---------------------------------+----------------------------------------------------------------------------------------------------------+
| min s/d/n | Minimum and/or maximum allowed values for input field. Can be used for numbers, dates, or strings. |
+---------------------------------+ |
......@@ -1896,6 +1897,12 @@ will be rendered inside the form as a HTML table.
subrecordTableClass = table table-hover qfq-subrecord-table tablesorter tablesorter-pager tablesorter-filter
* *subrecordTableAttribute*: Optional. Default: empty. Can be used to pass further html tags (attributes) to the subrecord table tag.
Typical use case is the :ref:`tablesorter-view-saver`::
subrecordTableClass = table table-hover qfq-subrecord-table tablesorter tablesorter-pager tablesorter-filter tablesorter-column-selector
subrecordTableAttribute = {{ 'allperson' AS _tablesorter-view-saver }}
* *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.
......
......@@ -2949,7 +2949,8 @@ The *tablesorter* options:
is shown.
* Class `tablesorter-column-selector` adds a column selector widget.
* Activate/Save/Delete `views`: Insert inside of a table html-tag the command::
.. _tablesorter-view-saver:
* Tablesorter view saver: Insert inside of a table html-tag the command::
{{ '<uniqueName>' AS _tablesorter-view-saver }}
......
......@@ -2299,6 +2299,9 @@ abstract class AbstractBuildForm {
$attribute = Support::doAttribute('class', $formElement[FE_SUBRECORD_TABLE_CLASS]);
$attribute .= Support::doAttribute('id', $tableSorterHtmlId);
if(isset($formElement[FE_SUBRECORD_TABLE_ATTRIBUTE])){
$attribute .= $this->evaluate->parse($formElement[FE_SUBRECORD_TABLE_ATTRIBUTE]);
}
return Support::wrapTag("<table $attribute>",
$htmlHead . Support::wrapTag("<tbody $dndAttributes>", $htmlBody), true);
......
......@@ -1342,6 +1342,7 @@ const FE_TEXTAREA_RESIZE = 'textareaResize';
const FE_EMPTY_ITEM_AT_START = 'emptyItemAtStart';
const FE_EMPTY_ITEM_AT_END = 'emptyItemAtEnd';
const FE_SUBRECORD_TABLE_CLASS = 'subrecordTableClass';
const FE_SUBRECORD_TABLE_ATTRIBUTE = 'subrecordTableAttribute';
const FE_FILE_BUTTON_TEXT = 'fileButtonText';
const FE_FILE_BUTTON_TEXT_DEFAULT = 'Choose File';
const FE_INPUT_TYPE = 'inputType';
......
......@@ -21,10 +21,16 @@ $(document).ready( function () {
tablesorterController.setup($(this), i);
}); // end .each()
$('.tablesorter-filter').addClass('qfq-skip-dirty');
} catch (e) {
console.log(e);
}
$('.tablesorter-filter').addClass('qfq-skip-dirty');
$('select.qfq-tablesorter-menu-item').addClass('qfq-skip-dirty');
$('.tablesorter-column-selector>label>input').addClass('qfq-skip-dirty');
// This is needed because after changing table-view, class of input field is empty again
$('button.qfq-column-selector').click(function () {
$('.tablesorter-column-selector>label>input').addClass('qfq-skip-dirty');
});
} catch (e) {
console.log(e);
}
$('.qfq-auto-grow').each(function() {
var minHeight = $(this).attr("rows") * 14 + 18;
......
......@@ -84,7 +84,12 @@ var QfqNS = QfqNS || {};
};
n.TablesorterController.prototype._doTablesorterMenuWrapper = function (table) {
var tablesorterMenuWrapperHtml = '<div class="qfq-tablesorter-menu-wrapper"></div>';
// in forms we need some distance to the top
var distanceStyle = '';
if($("div.qfq-form-body")[0] !== undefined){
distanceStyle = 'style="margin-top:25px;"';
}
var tablesorterMenuWrapperHtml = '<div class="qfq-tablesorter-menu-wrapper" '+distanceStyle+'></div>';
return $(tablesorterMenuWrapperHtml).insertBefore($(table));
};
......@@ -242,7 +247,7 @@ var QfqNS = QfqNS || {};
for (var key in parameters) {
hash += ',' + key + '=' + parameters[key];
}
window.location.hash = hash.substr(1);
window.location.replace("#"+hash.substr(1));
};
n.TablesorterController.prototype._getTablesorterUrlHash = function () {
......
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