• download
  • documentation
  • forums
  • demo
  • contact
  • blog

meteora

javascript widgets

Documentation

  • Autocomplete
  • Bubble
  • Calendar
  • Carousel
  • Datagrid
  • Dialog
  • Editor
  • Effect
  • Filebrowser
  • Form
  • Jsonrpc
  • Menu
  • Notebook
  • Picbox
  • Popup
  • Searchlist
  • Selection
  • Spinbutton
  • Tablesort
  • Toolbox
  • Treeview

What does this control do?

Shows a Dialog that can be dragged, minimized or maximized. This control is perfect for showing dynamic form elements, previews, etc.

For an usage example check out the Meteora.Popup demo.

How to use it

In order to use this control, paste this line of javascript right at the beginning of your script tag:

Meteora.uses('Meteora.Popup');

You may then by able to invoke the Filebrowser this way:

// Showing an AJAX resource
var popup = new Popup(
  'Test popup',
  {
    'url': '/path/to/ajax/content'
  }
);
// Showing an existing DOM object
var popup = new Popup(
  'Test popup',
  $('dom_object_id')
);
// Showing a simple text string
var popup = new Popup(
  'Test popup',
  'Hello world!'
);
// Opening an external site within an iframe
var popup = new Popup(
  'Test popup',
  'http://astrata.com.mx'
);
// Using standard HTML
var popup = new Popup(
  'Test popup',
  Widget.fromHTML('<b>Hello world!</b>')
);

Popup creation syntax

This is the basic syntax for a popup to be shown.

new Popup(
  // TITLE OF THE POPUP
  'Popup\'s title',
  // ELEMENT
  // This is a rich element, refer to the examples above
  // to see all the different things that you can put
  // inside.
  element,
 
  {
    // OPTIONS
  }
);

Options

top: px

Pixels from the top of the browser's window.

left: px

Pixels from the left of the browser's window.

width: px

Horizontal size of the widget.

height: px

Vertical size of the widget.

isResizable: boolean

Set true to allow the user to resize the widget.

isDraggable: boolean

Set true to allow the user to drag the widget across the screen.

onClose: event

A function that will be triggered when the user closes the widget.

onResize: event

A function that will be triggered when the user changes the size of the widget.

onMinimize: event

A function that will be triggered when the user minimized the widget.

onMaximize: event

A function that will be triggered when the user maximizes the widget.

onRestore: event

A function that will be triggered when the user restores the widget after minimizing or maximizing it.

onFocus: event

A function that will be triggered when the user focuses the widget.

onBlur: event

A function that will be triggered when the widget loses its focus.

Methods

setContent(element)

Changes the content of the widget. Refer to the general examples to know what kind of data you can insert.

minimize()

Hides the widget leaving a small button at the bottom of the screen for restoring it.

maximize()

Changes the size of the widget to completely cover the browser's window.

restore()

Reverts the original size of the widget after being minimized or maximized.

center()

Places the widget right at the center of the screen.

resizeTo(width, height)

Changes the size of the widget.

moveTo(top, left)

Sets the distance from the top and distance from the left values of the widget.

close()

Destroys the widget (if you want to reuse it later, use hide() instead of close()).

hide()

Makes the widget hidden, it will be still in memory.

show()

Makes a hidden widget visible again.

focus()

Focuses the widget.

blur()

Makes the widget lose its focus.

setOnTop()

Sets the widget on top of all other HTML elements.

Copyright © 2007-2009 Astrata Software.