[Rt-commit] rt branch, 4.6/update-query-builder-display-columns, created. rt-4.4.4-768-ge98e6c827
Craig Kaiser
craig at bestpractical.com
Thu Feb 13 16:02:21 EST 2020
The branch, 4.6/update-query-builder-display-columns has been created
at e98e6c8279af4ea5b79a8614c3c3b3ebc38be6f1 (commit)
- Log -----------------------------------------------------------------
commit 958a9ffed84596a6c6482ca9ea74d2e606f883f1
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 b145e8def..4e1b417a4 100644
--- a/share/html/Search/Elements/EditFormat
+++ b/share/html/Search/Elements/EditFormat
@@ -56,9 +56,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) {
@@ -67,6 +72,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);
@@ -86,7 +92,7 @@ jQuery( function() {
<div class="col-md-3">
<div class="form-row">
<div class="col-md-12">
- <select name="SelectDisplayColumns" multiple="multiple" class="form-control selectpicker">
+ <select name="SelectDisplayColumns" multiple="multiple">
% my %seen;
% foreach my $field ( grep !$seen{lc $_}++, @$AvailableColumns) {
<option value="<% $field %>" <% $selected{$field} ? 'selected="selected"' : '' |n%>>\
commit e98e6c8279af4ea5b79a8614c3c3b3ebc38be6f1
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 4e1b417a4..11f98a1e0 100644
--- a/share/html/Search/Elements/EditFormat
+++ b/share/html/Search/Elements/EditFormat
@@ -109,7 +109,7 @@ jQuery( function() {
%# leave 1 col to save some space to the right "->"
<div class="col-md-8 value">
<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