user198729
user198729

Reputation: 63686

How does phpmyadmin open a small window both in firefox and IE?

When you edit a datetime column via its datepickup,a window pops up instead of a new tab.

How to do it?

I tried window.open(..) but it just opens a new tab.

Upvotes: 0

Views: 389

Answers (3)

Sampson
Sampson

Reputation: 268424

You'll need to provide more than just the url: https://developer.mozilla.org/En/DOM/Window.open - take a look at the windowFeatures parameter. They happen to be using the following function:

function openCalendar(params, form, field, type) {
    window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
    dateField = eval("document." + form + "." + field);
    dateType = type;
}

Upvotes: 0

robertbasic
robertbasic

Reputation: 4335

It calls a openCalendar function which looks like this:

function openCalendar(params, form, field, type, fieldNull) {
    window.open("./calendar.php?" + params, "calendar", "width=400,height=200,status=yes");
    dateField = eval("document." + form + "." + field);
    dateType = type;
    if (fieldNull != '') {
        dateFieldNull = eval("document." + form + "." + fieldNull);
    }
} 

Basically just setting the width and height attributes (btw, if it's opening in a new tab, it's your browser that opens it that way, not the javascript).

Upvotes: 0

Coxy
Coxy

Reputation: 8928

I don't know phpmyadmin in particular, but could it be:

window.showModalDialog(...);

showModalDialog("URL"[, arguments[, "features"]])

http://javascript.gakaa.com/window-showmodaldialog-4-0-5-.aspx

Upvotes: 1

Related Questions