Book Image

Mastering ArcGIS Server Development with JavaScript

By : Raymond Kenneth Doman
Book Image

Mastering ArcGIS Server Development with JavaScript

By: Raymond Kenneth Doman

Overview of this book

Table of Contents (18 chapters)
Mastering ArcGIS Server Development with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Working with Evented modules


The Evented module lets your widgets publish events. When your module is declared with Evented as the parent class, it provides an emit() method for broadcasting that the event has occurred, and an on() method for listening to events. One example that can be found in the ArcGIS API would be the drawing toolbar. It doesn't display information, but it has the tools necessary to publish events.

The emit() method takes two arguments. The first is a string name that describes the event, such as map-loaded or records-received. The second is an object created and passed along with the event. The object could be anything you can create in JavaScript, but remember to keep the returned content similar, so that the methods listening for the event to occur don't miss it.