Commit 6489f848 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

sorting in edit project dialog fixed

parent d78cd97a
......@@ -106,6 +106,13 @@ GuiConnector.prototype.init = function () {
};
}
newUrl = "";
//sorting of datatable column by input value https://stackoverflow.com/a/29221907/1127920
$.fn.dataTable.ext.order['dom-input'] = function (settings, col) {
return this.api().column(col, {order: 'index'}).nodes().map(function (td, i) {
return $('input', td).val();
});
}
};
......
......@@ -61,7 +61,8 @@ CommentsAdminPanel.prototype._createGui = function () {
}, {
title: 'Content'
}, {
title: 'Removed'
title: 'Removed',
orderable: false
}, {
title: 'Pinned'
}]
......
......@@ -325,13 +325,17 @@ EditProjectDialog.prototype._createMapsTable = function () {
}, {
title: 'Name'
}, {
title: 'Default center x'
title: 'Default center x',
orderable: false
}, {
title: 'Default center y'
title: 'Default center y',
orderable: false
}, {
title: 'Default zoom level'
title: 'Default zoom level',
orderable: false
}, {
title: 'Update'
title: 'Update',
orderable: false
}]
});
......@@ -397,18 +401,31 @@ EditProjectDialog.prototype._createOverlayTable = function () {
}, {
title: 'Description'
}, {
title: 'Public'
title: 'Public',
orderable: false
}, {
title: 'Default'
title: 'Default',
orderable: false
}, {
title: 'Owner'
title: 'Owner',
orderable: false
}, {
title: 'Data'
title: 'Data',
orderable: false
}, {
title: 'Update'
title: 'Update',
orderable: false
}, {
title: 'Remove'
title: 'Remove',
orderable: false
}],
columnDefs: [
{
orderDataType: "dom-input",
type: "string",
targets: [1, 2]
}
],
dom: '<"minerva-datatable-toolbar">frtip',
initComplete: function () {
$("div.minerva-datatable-toolbar", $(result)).html('<button name="addOverlay">Add overlay</button>');
......@@ -437,7 +454,7 @@ EditProjectDialog.prototype._createOverlayTable = function () {
var button = this;
return self.getServerConnector().getOverlaySourceDownloadUrl({
overlayId: $(button).attr("data"),
projectId:self.getProject().getProjectId()
projectId: self.getProject().getProjectId()
}).then(function (url) {
return self.downloadFile(url);
}).then(null, GuiConnector.alert);
......@@ -622,7 +639,8 @@ EditProjectDialog.prototype.initUsersTab = function () {
var columns = self.createUserPrivilegeColumns();
$(usersTable).DataTable({
columns: columns
columns: columns,
ordering: false
});
return Promise.resolve();
};
......
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