mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-10 00:11:22 +08:00
Fix for hidden columns
This commit is contained in:
parent
3a76753b72
commit
d797469e38
2 changed files with 33 additions and 31 deletions
|
|
@ -145,19 +145,19 @@ var RepositoryDatatable = (function(global) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Helper functions
|
// Helper functions
|
||||||
function listItemDropdown(options, currentValue, columnId) {
|
// function listItemDropdown(options, currentValue, columnId) {
|
||||||
var html = `<select class="form-control selectpicker repository-dropdown"
|
// var html = `<select class="form-control selectpicker repository-dropdown"
|
||||||
data-abs-min-length="2" data-live-search="true"
|
// data-abs-min-length="2" data-live-search="true"
|
||||||
data-container="body" column_id="${columnId}">
|
// data-container="body" column_id="${columnId}">
|
||||||
<option value="-1"></option>`;
|
// <option value="-1"></option>`;
|
||||||
$.each(options, function(index, value) {
|
// $.each(options, function(index, value) {
|
||||||
var selected = (currentValue === value[1]) ? 'selected' : '';
|
// var selected = (currentValue === value[1]) ? 'selected' : '';
|
||||||
html += '<option value="' + value[0] + '" ' + selected + '>';
|
// html += '<option value="' + value[0] + '" ' + selected + '>';
|
||||||
html += value[1] + '</option>';
|
// html += value[1] + '</option>';
|
||||||
});
|
// });
|
||||||
html += '</select>';
|
// html += '</select>';
|
||||||
return html;
|
// return html;
|
||||||
}
|
// }
|
||||||
|
|
||||||
function initRowSelection() {
|
function initRowSelection() {
|
||||||
// Handle clicks on checkbox
|
// Handle clicks on checkbox
|
||||||
|
|
@ -401,24 +401,24 @@ var RepositoryDatatable = (function(global) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function initialListItemsRequest(columnId) {
|
// function initialListItemsRequest(columnId) {
|
||||||
var massageResponse = [];
|
// var massageResponse = [];
|
||||||
$.ajax({
|
// $.ajax({
|
||||||
url: $(TABLE_ID).data('list-items-path'),
|
// url: $(TABLE_ID).data('list-items-path'),
|
||||||
type: 'POST',
|
// type: 'POST',
|
||||||
dataType: 'json',
|
// dataType: 'json',
|
||||||
async: false,
|
// async: false,
|
||||||
data: {
|
// data: {
|
||||||
q: '',
|
// q: '',
|
||||||
column_id: columnId
|
// column_id: columnId
|
||||||
}
|
// }
|
||||||
}).done(function(data) {
|
// }).done(function(data) {
|
||||||
$.each(data.list_items, function(index, el) {
|
// $.each(data.list_items, function(index, el) {
|
||||||
massageResponse.push([el.id, el.data]);
|
// massageResponse.push([el.id, el.data]);
|
||||||
});
|
// });
|
||||||
});
|
// });
|
||||||
return listItemDropdown(massageResponse, '-1', columnId);
|
// return listItemDropdown(massageResponse, '-1', columnId);
|
||||||
}
|
// }
|
||||||
|
|
||||||
function initSelectPicker() {
|
function initSelectPicker() {
|
||||||
$('.selectpicker')
|
$('.selectpicker')
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,8 @@ var RepositoryDatatableRowEditor = (function() {
|
||||||
let dataType = $header.data('type');
|
let dataType = $header.data('type');
|
||||||
let cell = this;
|
let cell = this;
|
||||||
|
|
||||||
|
if (!cell.column(cell.index().column).visible()) return true; // return if cell is not visible
|
||||||
|
|
||||||
if (columnId === NAME_COLUMN_ID) {
|
if (columnId === NAME_COLUMN_ID) {
|
||||||
$.fn.dataTable.render.editRowName(formId, cell);
|
$.fn.dataTable.render.editRowName(formId, cell);
|
||||||
} else if (dataType) {
|
} else if (dataType) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue