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

@ -32,3 +32,4 @@ Bug fixes
| `Issue #4508 <https://redmine.postgresql.org/issues/4508>`_ - Fix accessibility issue for Datetime cell in backgrid.
| `Issue #4520 <https://redmine.postgresql.org/issues/4520>`_ - Ensure the query tool will work with older versions of psycopg2 than we officially support, albeit without updatable resultsets.
| `Issue #4525 <https://redmine.postgresql.org/issues/4525>`_ - Ensure command tags are shown in the messages tab of the Query Tool.
| `Issue #4536 <https://redmine.postgresql.org/issues/4536>`_ - Fix load on demand in View/Edit data mode.

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 = '';