[Rt-commit] rt branch, 4.6/update-query-builder-display-columns, created. rt-5.0.0alpha1-205-g86c92d2f44
Craig Kaiser
craig at bestpractical.com
Fri May 1 16:40:53 EDT 2020
The branch, 4.6/update-query-builder-display-columns has been created
at 86c92d2f445fbb47444000478b472429b0b51604 (commit)
- Log -----------------------------------------------------------------
commit db42463cb33dfe30015804fa954fba667438a39c
Author: Craig Kaiser <craig at bestpractical.com>
Date: Thu Feb 13 10:25:25 2020 -0500
Use selectize.js for display columns add columns input
diff --git a/share/html/Search/Elements/EditFormat b/share/html/Search/Elements/EditFormat
index 598235cb89..a54d3a4789 100644
--- a/share/html/Search/Elements/EditFormat
+++ b/share/html/Search/Elements/EditFormat
@@ -58,9 +58,14 @@
<script type="text/javascript">
jQuery( function() {
+ jQuery('select[name=SelectDisplayColumns]').each(function(d) {
+ jQuery(this).selectize();
+ });
+
jQuery('[name=AddCol], [name=RemoveCol], [name=ColUp], [name=ColDown]').click( function() {
var name = jQuery(this).attr('name');
var form = jQuery(this).closest('form');
+
jQuery.ajax({
url: '<% RT->Config->Get('WebPath') %>/Helpers/BuildFormatString?' + name + '=1&' + form.serialize(),
success: function (data) {
@@ -69,6 +74,7 @@ jQuery( function() {
form.find('select[name=CurrentDisplayColumns]').html(data.CurrentDisplayColumns);
form.find('select[name=SelectDisplayColumns]').val('').change();
form.find('[name=Link],[name=Title],[name=Size],[name=Face]').val('');
+ form.find('[name=Link],[name=Title],[name=Size],[name=Face]').selectpicker('refresh');
}
else {
alert('<% loc("Failed to update format. Reason:") %>' + ' ' + data.message);
@@ -87,8 +93,8 @@ jQuery( function() {
<div class="col-12 col-md-3">
<div class="form-row">
- <div class="col-12">
- <select name="SelectDisplayColumns" multiple="multiple" class="form-control selectpicker">
+ <div class="col-md-12">
+ <select name="SelectDisplayColumns" multiple="multiple">
% my %seen;
% foreach my $field ( grep !$seen{lc $_}++, @$AvailableColumns) {
<option class="<% CSSClass($field) %>" value="<% $field %>" <% $selected{$field} ? 'selected="selected"' : '' |n%>>\
commit 86c92d2f445fbb47444000478b472429b0b51604
Author: Craig Kaiser <craig at bestpractical.com>
Date: Thu Feb 13 10:43:50 2020 -0500
Use empty quotes for 'None' value of Link display columns input
After we add a new display column to the search format we clear the
Link, Title, Size and style inputs by setting their value to "".
Having the None value for Link be different results in a Bootstrap
selectpicker JavaScript error as "" is not a valid value for Link.
diff --git a/share/html/Search/Elements/EditFormat b/share/html/Search/Elements/EditFormat
index a54d3a4789..ffd30281ee 100644
--- a/share/html/Search/Elements/EditFormat
+++ b/share/html/Search/Elements/EditFormat
@@ -111,7 +111,7 @@ jQuery( function() {
%# leave 1 col to save some space to the right "->"
<div class="value col-8">
<select name="Link" class="form-control selectpicker">
- <option value="None">-</option>
+ <option value="">-</option>
<option value="Display"><&|/l&>Display</&></option>
% if ($IncludeTicketLinks) {
<option value="Take"><&|/l&>Take</&></option>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list