Completed the Ajax conversion for Edit User action.
Converted the pagination for the users table to Ajax, still a little buggy.
This commit is contained in:
@@ -97,13 +97,13 @@ function suggestPassword(passwd_form) {
|
|||||||
/**
|
/**
|
||||||
* Add all AJAX scripts for server_privileges page here.
|
* Add all AJAX scripts for server_privileges page here.
|
||||||
*
|
*
|
||||||
* Actions to be ajaxified here:
|
* Actions ajaxified here:
|
||||||
* Add a new user - done
|
* Add a new user
|
||||||
* Revoke a user (and also drop databases with same name as user) - #fieldset_delete_user #buttonGo - confirm, ajax post.
|
* Revoke a user
|
||||||
* Edit privileges - no id/class yet. 7th col in table - use dialog, submit form
|
* Edit privileges
|
||||||
* Export privileges - no id/class yet. 8th col in table - use ajax and load response. new div container necessary for response
|
* Export privileges
|
||||||
* Paginate table of users - use ajax, replace #usersForm
|
* Paginate table of users - use ajax, replace #usersForm
|
||||||
* Flush privileges - done!
|
* Flush privileges
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
@@ -205,11 +205,32 @@ $(document).ready(function() {
|
|||||||
$("#edit_user_dialog")
|
$("#edit_user_dialog")
|
||||||
.append(data)
|
.append(data)
|
||||||
.dialog({
|
.dialog({
|
||||||
width: 900
|
width: 900,
|
||||||
//buttons: { }
|
buttons: {"Cancel": function() {$(this).dialog("close").remove() ;}}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$("#edit_user_dialog").find("form").live('submit', function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
PMA_ajaxShowMessage(PMA_messages['strProcessingRequest']);
|
||||||
|
|
||||||
|
$(this).append('<input type="hidden" name="ajax_request" value="true" />');
|
||||||
|
|
||||||
|
var curr_submit_name = $(this).find('.tblFooters').find('input:submit').attr('name');
|
||||||
|
var curr_submit_value = $(this).find('.tblFooters').find('input:submit').val();
|
||||||
|
|
||||||
|
$.post($(this).attr('action'), $(this).serialize() + '&' + curr_submit_name + '=' + curr_submit_value, function(data) {
|
||||||
|
if(data.success == true) {
|
||||||
|
PMA_ajaxShowMessage(data.message);
|
||||||
|
$("#edit_user_dialog").dialog("close").remove();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
PMA_ajaxShowMessage(data.error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
//end Edit user
|
//end Edit user
|
||||||
|
|
||||||
//Export Privileges
|
//Export Privileges
|
||||||
@@ -230,4 +251,23 @@ $(document).ready(function() {
|
|||||||
}) //end $.get
|
}) //end $.get
|
||||||
}) //end export privileges
|
}) //end export privileges
|
||||||
|
|
||||||
|
//Paginate Users Table
|
||||||
|
$("#initials_table").find("a").live('click', function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
PMA_ajaxShowMessage();
|
||||||
|
|
||||||
|
$.get($(this).attr('href'), {'ajax_request' : true}, function(data) {
|
||||||
|
$("#usersForm")
|
||||||
|
.hide("medium")
|
||||||
|
.siblings("#topmenucontainer")
|
||||||
|
.after(data)
|
||||||
|
.show("medium")
|
||||||
|
.end()
|
||||||
|
.remove();
|
||||||
|
$("#topmenucontainer").siblings("#initials_table").not(":first").remove();
|
||||||
|
$("#initials_table").siblings("h2").not(":first").remove();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
}); //end $(document).ready()
|
}); //end $(document).ready()
|
Reference in New Issue
Block a user