I am new to using Dart. I was wonder how do I create a pop-up window based on an event? i know how to create the event but not sure how to create the pop-up window.
void main()
{
List<Element> radioButtons = queryAll(".requestType");
Iterator i = radioButtons.iterator();
while(i.hasNext)
{
var item = i.next();
item.on.click.add(addRequestTypeEvent);
}
}
void addRequestTypeEvent(Event event) {
<POPUP WINDOW>
}
Update 01/17/2013: I figured out how to do it.
window.open("http://www.yahoo.com", "yahoo", "status = 1, height = 300, width = 300, resizable = 0");
Just use Window.open:
window.open(url, name);
You can read more on what options
you can give as third parameter on MDN.
One more thing, you can simplify your code. The following does the same :
void main()
{
final radioButtons = queryAll(".requestType");
// with forEach method
radioButtons.forEach((item) => item.on.click.add(addRequestTypeEvent));
// with for loop
for (final item in radioButtons) {
item.on.click.add(addRequestTypeEvent);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With