Conditional Ajax on display Options

This commit is contained in:
Marc Delisle
2011-02-05 07:57:30 -05:00
parent 8b72097fb0
commit 9443d6efc2
2 changed files with 13 additions and 5 deletions

View File

@@ -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

View File

@@ -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 '<form method="post" action="sql.php" name="displayOptionsForm" id="displayOptionsForm">';
echo '<form method="post" action="sql.php" name="displayOptionsForm" id="displayOptionsForm"';
if ($GLOBALS['cfg']['AjaxEnable']) {
echo ' class="ajax" ';
}
echo '>';
$url_params = array(
'db' => $db,
'table' => $table,