diff --git a/docs/en_US/release_notes_4_12.rst b/docs/en_US/release_notes_4_12.rst index 14c046ebc..ebb3b3d3c 100644 --- a/docs/en_US/release_notes_4_12.rst +++ b/docs/en_US/release_notes_4_12.rst @@ -31,4 +31,5 @@ Bug fixes | `Issue #4497 `_ - Ensure purely numeric comments can be saved on new columns. | `Issue #4508 `_ - Fix accessibility issue for Datetime cell in backgrid. | `Issue #4520 `_ - Ensure the query tool will work with older versions of psycopg2 than we officially support, albeit without updatable resultsets. -| `Issue #4525 `_ - Ensure command tags are shown in the messages tab of the Query Tool. \ No newline at end of file +| `Issue #4525 `_ - Ensure command tags are shown in the messages tab of the Query Tool. +| `Issue #4536 `_ - Fix load on demand in View/Edit data mode. \ No newline at end of file diff --git a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js index 5f7fde7c6..7f1e02412 100644 --- a/web/pgadmin/tools/sqleditor/static/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/static/js/sqleditor.js @@ -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 = '';