Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New datatable 103 #124

Merged
merged 6 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,103 changes: 1,103 additions & 0 deletions public/datatables/datatables.css

Large diffs are not rendered by default.

126,328 changes: 126,328 additions & 0 deletions public/datatables/datatables.js

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions public/datatables/datatables.min.css

Large diffs are not rendered by default.

79,774 changes: 79,774 additions & 0 deletions public/datatables/datatables.min.js

Large diffs are not rendered by default.

17 changes: 12 additions & 5 deletions public/javascripts/form-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -907,8 +907,12 @@ function number_edit($cgr) {
placeholder = $('.controls input', $cgr).attr('placeholder');
help = $('.controls span.help-block', $cgr).text();
required = $('input', $cgr).prop('required');
min = Number($('input', $cgr).prop('min'));
max = Number($('input', $cgr).prop('max'));
if ($('input', $cgr).prop('min')) {
min = Number($('input', $cgr).prop('min'));
}
if ($('input', $cgr).prop('max')) {
max = Number($('input', $cgr).prop('max'));
}
range = rangeText(min, max);
}

Expand Down Expand Up @@ -953,9 +957,12 @@ function number_edit($cgr) {
$('input', $placeholder).val(placeholder);
$('input', $help).val(help);
$('input', $required).prop('checked', required);
$('input', $min).val(min);
$('input', $max).val(max);

if (min !== null) {
$('input', $min).val(min);
}
if (max !== null) {
$('input', $max).val(max);
}
binding($edit, $number, model, $done);
}

Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/form-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $(function() {
data: JSON.stringify(data),
success: function(json) {
initValue[that.id] = json[that.id];
$(that).text(json[that.id]);
$(that).html(json[that.id]);
},
error: function(jqXHR) {
$(that).text(initValue[that.id]);
Expand Down
21 changes: 12 additions & 9 deletions public/javascripts/report.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,28 +81,31 @@ function constructTable(table, travelers, colMap) {
constructControl('#user-keys', userKeys);

// draw the table
var report = $(table).dataTable({
aaData: rows,
aoColumns: systemColumns.concat(discrepancyColumns).concat(userColumns),
oTableTools: oTableTools,
iDisplayLength: -1,
aLengthMenu: [[10, 50, 100, -1], [10, 50, 100, 'All']],
sDom: sDom,
var report = $(table).DataTable({
data: rows,
columns: systemColumns.concat(discrepancyColumns).concat(userColumns),
pageLength: -1,
lengthMenu: [
[10, 50, 100, -1],
[10, 50, 100, 'All'],
],
pagingType: 'simple_numbers',
dom: Dom,
});

// register column event handler
$('.inline-checkbox input.userkey').on('input', function() {
var show = $(this).prop('checked');
colMap[$(this).data('toggle')].forEach(function(c) {
report.fnSetColumnVis(c, show);
report.column(c).visible(show);
});
});

// register lable event hander
$('.inline-checkbox input.labels').on('input', function() {
var show = $(this).prop('checked');
labelColIndex.forEach(function(c) {
report.fnSetColumnVis(c, show);
report.column(c).visible(show);
});
});

Expand Down
2 changes: 2 additions & 0 deletions public/javascripts/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,8 @@ const oTableTools = {

const sDom =
"<'row-fluid'<'span6'<'control-group'T>>><'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>";
const Dom =
"<'row-fluid'<'span6'<'control-group'B>>><'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>";
const sDom2i =
"<'row-fluid'<'span6'<'control-group'T>>><'row-fluid'<'span3'l><'span3'i><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>";
const sDom2i1p =
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/traveler-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ $(function() {
data: JSON.stringify(data),
success: function(json) {
initValue[that.id] = json[that.id];
$(that).text(json[that.id]);
$(that).html(json[that.id]);
},
error: function(jqXHR) {
$(that).text(initValue[that.id]);
Expand Down
Loading