From 9443d6efc2359ba104714fc8d29a4ab2f2ac0447 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sat, 5 Feb 2011 07:57:30 -0500 Subject: [PATCH] Conditional Ajax on display Options --- js/sql.js | 12 ++++++++---- libraries/display_tbl.lib.php | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/js/sql.js b/js/sql.js index 843c37b5d..593cbe7de 100644 --- a/js/sql.js +++ b/js/sql.js @@ -338,13 +338,17 @@ $(document).ready(function() { * Ajax Event handler for the display options * @memberOf jQuery * @name displayOptionsForm_submit + * @see $cfg['AjaxEnable'] */ - $("#displayOptionsForm").live('submit', function(event) { + $("#displayOptionsForm.ajax").live('submit', function(event) { event.preventDefault(); - $.post($(this).attr('action'), $(this).serialize() + '&ajax_request=true' , function(data) { - $("#sqlqueryresults").html(data); - $("#sqlqueryresults").trigger('appendAnchor'); + $form = $(this); + + $.post($form.attr('action'), $form.serialize() + '&ajax_request=true' , function(data) { + $("#sqlqueryresults") + .html(data) + .trigger('appendAnchor'); }) // end $.post() }) //end displayOptionsForm handler diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 082e93cd2..7d0299ccf 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -540,7 +540,11 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0, $ // Display options (if we are not in print view) if (! (isset($GLOBALS['printview']) && $GLOBALS['printview'] == '1')) { - echo '
'; + echo ''; $url_params = array( 'db' => $db, 'table' => $table,