Commit 2bc17cb9 authored by Lukasz Waskiewicz's avatar Lukasz Waskiewicz
Browse files

refs #1444 poprawku GUI wyników zapytań

parent 60ca71ca
......@@ -209,6 +209,5 @@ Table.prototype.changePage = function(page, rewriteHistory, sortField, direction
$.extend(ajaxCallbacks, this.callbacks);
$.extend(ajaxCallbacks, callbacks);
console.warn(ajaxCallbacks)
table.ajax(pageContentUrl, data, ajaxCallbacks);
};
......@@ -25,7 +25,7 @@ AdministrationQueriesPage.prototype.initOperations = function(){
$.extend(queryOperationsSettings, page.settings);
QueryOperations.init(queryOperationsSettings);
QueryOperations.completedFunc = function (){
page.table.changePage(fetchCurrentPage(page.settings.paginatorId));
page.table.changePage(fetchCurrentPage(page.settings.paginationWrapperId));
}
};
......
......@@ -32,8 +32,10 @@ QueryResultsWidget.prototype.bindUiActions = function() {
minHeight : $("#recentQueries .panel-body").innerHeight()
});
}).on('shown.bs.tab', function() {
if ($("#resultsDataWrapper #resultsData").size() === 0) {
var queryId = $('#resultsNavigation a[href="#queriesResults"]').data('queryid');
var loadedQueryId = $('#resultsNavigation a[href="#queriesResults"]').data("loadedQueryId");
var queryId = $('#resultsNavigation a[href="#queriesResults"]').data('queryid');
if (loadedQueryId != queryId) {
QueryResultsDataWidget.loadResults(queryId, 1);
}
});
......@@ -65,6 +67,9 @@ QueryResultsWidget.prototype.handleQueryCompleted = function(message) {
if (message.query.status == 'EXECUTED') {
var resultsTab = $('#resultsNavigation a[href="#queriesResults"]').closest('li');
resultsTab.removeClass('disabled');
if ($('#queriesResults').hasClass('active')) {
QueryResultsDataWidget.loadResults(message.query.id, 1);
}
}
}
......@@ -78,8 +83,6 @@ QueryResultsWidget.prototype.loadQueryContext = function(queryId, query, complet
var queryRow = $("tr.resultElement[data-queryid='" + queryId + "']");
query = typeof query !== 'undefined' ? query : queryRow.find(".queryContent > div").text();
$("#resultsDataWrapper").html("");
$('#resultsNavigation a[href="#queriesResults"]').data('queryid', queryId)
console.debug("load context: " + queryId);
if (window.editor) {
......@@ -101,8 +104,9 @@ QueryResultsWidget.prototype.loadQueryContext = function(queryId, query, complet
});
$this.markResultElementAsSelected(queryId);
if ($('#queriesResults').hasClass('active')) {
if ($('#queriesResults').hasClass('active') && !resultsTab.hasClass('disabled')) {
// $("#resultsDataWrapper").html("");
QueryResultsDataWidget.loadResults(queryId, 1);
}
};
......
......@@ -50,16 +50,17 @@ QueryResultsDataWidget = {
},
loadResults : function(queryId, page, sortField, direction) {
console.debug("load results: " + queryId + " " + page);
var $this = this;
var activeSortingControl = $("#queryResultsPaginationWrapper .sortingWrapper a.active");
sortField = typeof sortField !== 'undefined' ? sortField : activeSortingControl.closest(".sortingWrapper").data('field');
direction = typeof direction !== 'undefined' ? direction : activeSortingControl.data('direction');
var pageSize = $this.settings.widgetWrapper.find(".changePageSizeBtn.currentPageSize").data("pagesize");
console.debug(pageSize);
var target = this.settings.widgetWrapper;
var resultsTab = $('#resultsNavigation a[href="#queriesResults"]').closest('li');
$('#resultsNavigation a[href="#queriesResults"]').data("loadedQueryId", queryId);
var data = {
queryId : queryId,
page : page,
......
......@@ -42,7 +42,7 @@ QueryTable.prototype.complete = function() {
} else {
this.waitingMessages = [];
console.info("refresh all waiting");
this.table.changePage(fetchCurrentPage(this.settings.paginatorId), false);
this.table.changePage(fetchCurrentPage(this.settings.paginationWrapperId), false);
}
}
}
......@@ -60,7 +60,7 @@ QueryTable.prototype.handleQueryCompleted = function(message) {
this.changeOneRow(message);
} else {
console.debug("refresh all trigeredBy "+message.query.id );
this.table.changePage(fetchCurrentPage(this.settings.paginatorId), false);
this.table.changePage(fetchCurrentPage(this.settings.paginationWrapperId), 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