[Phpmyadmin-devel] Ajaxification of PMA

Thilanka Kaushalya lgtkaushalya at gmail.com
Mon Mar 19 16:02:07 CET 2012


Hi Rouslan,

I personally wouldn't call that refactoring, but yeah, the clean-up
> looks pretty OK. Just one thing: when you are calling
> PMA_ajaxShowMessage() to display an error, you need to pass a second
> parameter with a false value. For example:
>
> PMA_ajaxShowMessage(data.error, false);
>
>
okay.


> More info at [1].
>
> I never said that you should not remove the dialog, you're just doing it
> wrong. The correct way to do this is by defining a callback that gets
> fired when the dialog is closed (this may happen in more than one way)
> and remove the dialog there. See example below.
>
> That because the buttons are not where they belong. They should go into
> the bottom pane of the dialog. For example:
>
> // Define some buttons that will go into the bottom pane
> // of the dialog and bind some callbacks to them
> var buttonOptions = {};
> buttonOptions[PMA_messages['strGo']] = function () {
>    // do something useful here
> };
> buttonOptions[PMA_messages['strClose']] = function () {
>    $(this).dialog("close");
> };
> // Create the dialog
> $someDiv.dialog({
>    buttons: buttonOptions,
>    close: function () {
>        // This is a callback that gets fired when the user
>        // or the system try to close the dialog
>        $(this).remove();
>    }
> });
>
>
Thanks for the clarification. Now I got the point and will update the
patch.

Regards,
Thilanka.


-- 
*Thilanka Kaushalya,
*                          *
*
Connect with me at,
      Gmail        : lgtkaushalya at gmail.com
      Twitter       : @thilanka_k
      Facebook  : lgtkaushalya
      Yahoo       : lgtkaushalya at yahoo.com
      Blog          : http://coders-view.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.phpmyadmin.net/pipermail/developers/attachments/20120319/78fec587/attachment.html>


More information about the Developers mailing list