Book Image

Learning DHTMLX Suite UI

By : Eli Geske
Book Image

Learning DHTMLX Suite UI

By: Eli Geske

Overview of this book

JavaScript applications provide an excellent user experience for small to large scale enterprise applications. The amazing growth of JavaScript has opened the door for many great libraries such as DHTMLX. "Learning DHTMLX Suite UI" will teach you how to use these libraries effectively so you can make presentations that will take your employer's/ client's breath away! "Learning DHTMLX Suite UI" is a step-by-step guide that will teach you the basics of DHTMLX library components and how to apply them in a real-world scenario. This book will start with the installation of DHTMLX before moving on to explore the features of DHTMLX and helping you to create your first user management application. "Learning DHTMLX Suite UI" will guide you through the installation of DHTMLX as a single-page application. As you progress from one chapter to the next, you will gradually build a simple user management application. You will also learn how to create forums with validation and how to use grids to add and edit users. The book will also suggest the best practices for using toolbars and refreshing data. With "Learning DHTMLX Suite UI Guide", you will be inspired to come up with your own great ideas for your future application development projects.
Table of Contents (17 chapters)
Learning DHTMLX Suite UI
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The application code


The application code for this chapter will create a pop-up window that will open when a grid row is double-clicked or when the when the add button on the toolbar is pressed. Once the pop-up window is created we do not want to recreate it again; so we will only hide and show it. To prevent the pop-up window from closing when the close button is pressed we will use the onClose event we discussed in the previous section.

Creating the pop-up window

Open the app.js file and add the following code at the end:

// Popup
var appPopup;
dhtmlxEvent(window, "load", function(){
   // create popup
   var win = new dhtmlXWindows();
   win.setImagePath(config.imagePath);
   appPopup = win.createWindow(1,null,null,400,300);
   appPopup.setText("User Add/Edit");
   appPopup.centerOnScreen();
   // popup events
   appPopup.attachEvent("onClose",callbacks.hidePopup);
   // hide popup initially
   appPopup.hide();
});

First we created the global variable as a reference to the pop-up window....