diff --git a/db_search.php b/db_search.php index fba68d17fe..d9d7ea13ac 100644 --- a/db_search.php +++ b/db_search.php @@ -38,6 +38,8 @@ require_once './libraries/common.inc.php'; $GLOBALS['js_include'][] = 'db_search.js'; +$GLOBALS['js_include'][] = 'sql.js'; +$GLOBALS['js_include'][] = 'makegrid.js'; /** * Gets some core libraries and send headers diff --git a/js/db_search.js b/js/db_search.js index 32c5c13d80..0cb04b7f28 100644 --- a/js/db_search.js +++ b/js/db_search.js @@ -26,7 +26,14 @@ function loadResult(result_path , table_name , link , ajaxEnable){ /** Load the browse results to the page */ $("#table-info").show(); $('#table-link').attr({"href" : 'sql.php?'+link }).text(table_name); - $('#browse-results').load(result_path + " '"+'#sqlqueryresults' + "'").show(); + $('#browse-results').load(result_path + " '"+'#sqlqueryresults' + "'", null, function() { + // because under db_search, window.parent.table is not defined yet, + // we assign it manually from #table-link + window.parent.table = $('#table-link').text().trim(); + + appendInlineAnchor(); + $('#table_results').makegrid(); + }).show(); } else { @@ -173,8 +180,6 @@ $(document).ready(function() { if (typeof response == 'string') { // found results $("#searchresults").html(response); - $("#sqlqueryresults").trigger('appendAnchor'); - $("#sqlqueryresults").trigger('makegrid'); $('#togglesearchresultlink') // always start with the Show message