Commit 85e014c0 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

refreshing of data doesn't change table page

parent dda3c993
Pipeline #3668 passed with stage
in 1 minute
......@@ -196,6 +196,7 @@ MapsAdminPanel.prototype.setProjects = function (projects) {
var self = this;
var dataTable = $($("[name='projectsTable']", self.getElement())[0]).DataTable();
var data = [];
var page = dataTable.page();
for (var i = 0; i < projects.length; i++) {
var project = projects[i];
var rowData = self.projectToTableRow(project);
......@@ -203,6 +204,7 @@ MapsAdminPanel.prototype.setProjects = function (projects) {
data.push(rowData);
}
dataTable.clear().rows.add(data).draw();
dataTable.page(page).draw(false);
};
MapsAdminPanel.prototype.addUpdateListener = function (project, dataTableRow) {
......
......@@ -179,6 +179,7 @@ UsersAdminPanel.prototype.init = function () {
UsersAdminPanel.prototype.setUsers = function (users) {
var self = this;
var dataTable = $($("[name='usersTable']", self.getElement())[0]).DataTable();
var page = dataTable.page();
var data = [];
for (var i = 0; i < users.length; i++) {
var user = users[i];
......@@ -187,6 +188,7 @@ UsersAdminPanel.prototype.setUsers = function (users) {
data.push(rowData);
}
dataTable.clear().rows.add(data).draw();
dataTable.page(page).draw(false);
};
......
Markdown is supported
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