From 49976b193476c7626c305853c23cbf9a98af68e8 Mon Sep 17 00:00:00 2001 From: Surinder Kumar Date: Fri, 9 Jun 2017 09:24:20 +0100 Subject: [PATCH] Fine tune result grid column sizing now we don't have checkboxes. --- web/pgadmin/static/js/sqleditor_utils.js | 2 +- .../sqleditor/templates/sqleditor/js/sqleditor.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/pgadmin/static/js/sqleditor_utils.js b/web/pgadmin/static/js/sqleditor_utils.js index 2afc4de5f..e09dde16a 100644 --- a/web/pgadmin/static/js/sqleditor_utils.js +++ b/web/pgadmin/static/js/sqleditor_utils.js @@ -48,7 +48,7 @@ define(['jquery'], $('body').append( '' ); - var width = $('#pg_text').width() + 30; + var width = $('#pg_text').width() + 23; $('#pg_text').remove(); // remove element return width; diff --git a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js index f21d3332e..da24f7714 100644 --- a/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js +++ b/web/pgadmin/tools/sqleditor/templates/sqleditor/js/sqleditor.js @@ -559,15 +559,15 @@ define([ // Get the columns width based on longer string among data type or // column name. - var label = c.label.split('
'); - label = label[0].length > label[1].length ? label[0] : label[1]; + var column_type = c.column_type.trim(); + var label = c.name.length > column_type.length ? c.name : column_type; if (_.isUndefined(column_size[table_name][c.name])) { - options['width'] = SqlEditorUtils.calculateColumnWidth(label) - column_size[table_name][c.name] = SqlEditorUtils.calculateColumnWidth(label); + options['width'] = SqlEditorUtils.calculateColumnWidth(label); + column_size[table_name][c.name] = options['width']; } else { - options['width'] = column_size[table_name][c.name]; + options['width'] = column_size[table_name][c.name]; } // If grid is editable then add editor else make it readonly