Fix load on demand in View/Edit data mode. Fixes #4536

This commit is contained in:
Yosry Muhammad
2019-08-02 10:39:19 +01:00
committed by Dave Page
parent 537c27a58e
commit 0cfd76c279
2 changed files with 11 additions and 8 deletions

View File

@@ -716,8 +716,6 @@ define('tools.querytool', [
self.handler.rows_to_disable = new Array();
// Temporarily hold new rows added
self.handler.temp_new_rows = new Array();
self.handler.has_more_rows = false;
self.handler.fetching_rows = false;
// To store primary keys before they gets changed
self.handler.primary_keys_data = {};
@@ -2247,8 +2245,8 @@ define('tools.querytool', [
self.on('pgadmin-sqleditor:unindent_selected_code', self._unindent_selected_code, self);
},
// This function checks if there is any dirty data in the grid before
// it executes the sql query
// Checks if there is any dirty data in the grid before
// it executes the sql query in View Data mode
execute_data_query: function() {
var self = this;
@@ -2277,7 +2275,7 @@ define('tools.querytool', [
}
},
// This function makes the ajax call to execute the sql query.
// This function makes the ajax call to execute the sql query in View Data mode
_run_query: function() {
var self = this,
url = url_for('sqleditor.view_data_start', {
@@ -2288,6 +2286,9 @@ define('tools.querytool', [
self.rows_affected = 0;
self._init_polling_flags();
self.has_more_rows = false;
self.fetching_rows = false;
self.trigger(
'pgadmin-sqleditor:loading-icon:show',
gettext('Running query...')
@@ -3665,8 +3666,8 @@ define('tools.querytool', [
}
},
// This function will fetch the sql query from the text box
// and execute the query.
// Checks if there is any dirty data in the grid before
// it executes the sql query in Query Tool mode
execute: function(explain_prefix, shouldReconnect=false) {
var self = this;
@@ -3695,6 +3696,7 @@ define('tools.querytool', [
}
},
// Executes sql query in the editor in Query Tool mode
_execute_sql_query: function(explain_prefix, shouldReconnect) {
var self = this, sql = '';