First I added the class="ajax" attribute to the "Add a new user link" when the Ajax in enabled. Then It became supporting to the same logic in $("#fieldset_add_user a.ajax").live("click") event.
At that point when we click on the "Add a new User" link, it successfully popups the dialog box which is carrying the "Add user" form and after we submit it correctly create that user. But still its not done. Because I had to reload the "db specific user rights" table at the db->privileges tab.
After discussing with Marc I decided to use a post command to get the updated "db specific user rights" table in db->privileges and replace it with the current table. So in oder to do so I had to remove the echoes of the "db specific user rights" form in server_privileges.php file and use the PMA_ajaxResponse() to pass the string of the table object as a json string.
Then I had to face a problem of not parsing the json string correctly and outputs error. So I used the $.parseJSON() function to parse the json string at the server_privileges.js file. Then it worked fine and reloaded the "db specific user rights" table with newly added user.
Then Marc directed me to a new scenario in host->databases->check_privileges->"Add a new user" which gave some errors because of my modification. Finally I have modified the logic which corrects the error and now the feature is working correctly.
Add user dialog
Now the "Add a new user" in db->privileges option works fine with the ajax behavior and I think it will help to improve the usability of PMA.
Next week I'm going to work with modifying the "Insert for a table" option in db->structure, which will apply the ajax behavior to it.
No comments:
Post a Comment