Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Learning DHTMLX Suite UI
Learning DHTMLX Suite UI

Learning DHTMLX Suite UI: Create your first single-page JavaScript application using multiple DHTMLX components and a touch of HTML5

eBook
$9.99 $19.99
Paperback
$32.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Learning DHTMLX Suite UI

Chapter 2. Download, Setup, and Test

In this chapter, we will go over downloading the DHTMLX library, creating the base files and directory structure, and including the library files. We will then write the configuration for the application and test the installation with Google Chrome developer tools.

Installing a web server


DHTMLX requires the application be used on a web server to allow all functionality to work. There are several preconfigured web server packages available for downloading on the Internet.

One of the options for Windows is WampServer. It is available at http://www.wampserver.com. For Mac users, one of the popular web server packages is MAMP. It is available at http://www.mamp.info.

Each of these websites provides instructions on using their packages.

Once you have a web server running, you must locate a directory accessible through the web server where you would like to create the application. The examples in this book will be using the root of an installed web server as the application directory and accessing the application at http://localhost/. The book will also refer to the root as the application directory.

Creating the application directory structure


Before downloading the DHTMLX components library, we need to create the application directory structure on our web server.

Locate the directory accessible on the web server where you will be hosting the application. This directory will be your application directory.

Now, create a new folder named js in the application directory. Inside the js folder, create a new folder named application and another named dhtmlx. Your directory structure should appear as shown in the following figure:

We will place all of the JavaScript files that we create for the application inside the application folder. The DHTMLX library code will be placed inside the dhtmlx folder.

Downloading the DHTMLX library


Now, we are going to download the DHTMLX library from their website and select which files will be used.

Open up your favorite web browser and navigate to www.dhtmlx.com. Here you will see a Download link in the menu. Click on the link. You should now see a page that looks like the following screenshot:

We want to download the entire library of components. DHTMLX calls this the Suite. Locate the Download link on the page for the Standard Edition of the Suite and click on the link. This will begin the download of a ZIP file. Download it to a location other than the application directory so that we can extract and choose which files we will use.

Open the extracted folder in your file manager to view its contents. You will see that it contains many folders, a license file, a readme file, an index.html file, and several more ZIP files.

Note

DHTMLX can be installed as individual components or as an entire suite.

The folders you see contain the individual components, which...

Creating the application file app.js


The first application file is the app.js file. This will contain all of the JavaScript to create the components and interactions.

Let's start by creating the app.js file in the js/application directory.

Inside this file, add a config object at the top as shown in the following snippets:

var config = {
   imagePath: "js/dhtmlx/imgs/",
   iconPath: ""
}

This config object contains the global properties for the DHTMLX components. The imagePath property is the path where the images reside for the components styling. The second one which we left blank is the path where the icons will be stored. Icons can be used in several different components like the Modal Window header and the toolbar buttons.

Icons do not come with DHTMLX and have to be added from a free or purchased icons library.

The data storage file


The next file which we will create for the application is the storage.js file. This file will contain the mini data access layer that will speak to HTML5 localStorage. It will contain all of the CRUD methods for the users and displays.

Now, create a new JavaScript file in the js/application directory named storage.js. We will add code to this later.

Next, we will add an HTML file that will join the application code together.

Creating the index.html file


The application will be accessed through the index.html file located in the root of the application directory. We will set this up now.

In the root of the application directory, add a new file named index.html. This should be accessible from http://localhost/index.html.

Now, add the markup for an HTML5 document and include the external DHTMLX files:

<!DOCTYPE html>
<html lang="en">
   <head>
   <title>Users</title>
   <link href="js/dhtmlx/dhtmlx.css" type="text/css" 
      rel="stylesheet" />  
   <style>
      /* layout css */
      html, body { height: 100%; width: 100%; }
   </style>    
<script src="js/dhtmlx/dhtmlx.js"></script>
<script src="js/application/storage.js"></script>
<script src="js/application/app.js"></script>
   </head>
   <body>    
</body>
</html>

Tip

Downloading the example code

You can download the example code files for all Packt books...

Testing the DHTMLX installation


We now have the necessary file structure and the index.html file created. This file includes the external DHTMLX CSS and JavaScript files for the application.

Next, we will talk about the Chrome developer tools and test if the DHTMLX library files were included correctly.

Open the Chrome web browser and navigate to http://localhost/ or http://localhost/index.html, loading the index.html file.

You should see a blank page displayed.

To make JavaScript development easy, Chrome provides the developer tools. This provides many useful tools for developing applications on the Web. The tool that we will focus on is the console. There are two ways to access the Chrome developer tools console window: through the Chrome menu or through keyboard shortcuts. Let's use the keyboard shortcuts approach. On Windows and Linux, the keyboard shortcut is Ctrl + Shift + J, and for Mac, it is Cmd + Opt + J. With the provided keyboard shortcuts, open the developer tools console window...

Summary


In this chapter, we covered downloading the DHTMLX Suite and the local documentation. We also created all of the necessary files to start the application, and explored using the Chrome developer tools. We touched on global configuration variables and what the storage file will be used for. You should be pretty comfortable for future chapters when asked to open one of these files or developer tools to add lines of code.

In the next chapter, we will start writing code that will access the storage and create the data structures for the components.

Left arrow icon Right arrow icon

Key benefits

  • Learn how to install and use DHTMLX methods and events
  • Store data in HTML5 local storage
  • Learn how to develop a client-side application using DHTMLX and browser tools

Description

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.

Who is this book for?

"Learning DHTMLX Suite UI" is for web designers who have a basic knowledge of JavaScript and who are looking for powerful tools that will give them an extra edge in their own application development. This book is also useful for experienced developers who wish to get started with DHTMLX without going through the trouble of learning its quirks through trial and error. Readers are expected to have some knowledge of JavaScript, HTML, Document Object Model, and the ability to install a local web server.

What you will learn

  • Understand the benefits of DHTMLX and other libraries
  • Download and install DHTMLX as a suite
  • Set up JavaScript objects to manage data and component interactions
  • Learn about the initialization and manipulation of Layouts, Grids, Toolbars, Windows, Forms, and Charts
  • Use events to sync interactions
  • Utilize form validations and calendar pickers
  • Employ JSON data structures for Grids and Charts
  • Create a single-page JavaScript application with DHTMLX components

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Oct 25, 2013
Length: 132 pages
Edition : 1st
Language : English
ISBN-13 : 9781849699341

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Oct 25, 2013
Length: 132 pages
Edition : 1st
Language : English
ISBN-13 : 9781849699341

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 65.98
JavaScript and JSON Essentials
$32.99
Learning DHTMLX Suite UI
$32.99
Total $ 65.98 Stars icon
Banner background image

Table of Contents

10 Chapters
User Management Web App Chevron down icon Chevron up icon
Download, Setup, and Test Chevron down icon Chevron up icon
Data Structures, Storage, and Callbacks Chevron down icon Chevron up icon
The DHTMLX Layout Chevron down icon Chevron up icon
The DHTMLX Toolbar Chevron down icon Chevron up icon
The DHTMLX Grid Chevron down icon Chevron up icon
The DHTMLX Window Chevron down icon Chevron up icon
The DHTMLX Form and Calendar Chevron down icon Chevron up icon
The DHTMLX Chart Chevron down icon Chevron up icon
The Finish Line Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9
(7 Ratings)
5 star 57.1%
4 star 14.3%
3 star 0%
2 star 14.3%
1 star 14.3%
Filter icon Filter
Top Reviews

Filter reviews by




Randall Ochmann Apr 30, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good place to start.
Amazon Verified review Amazon
JohnM Undisclosed Nov 09, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great intro to dhtmlx application structure. Exactly what I needed to get acquainted with the capabilities of dhmtlx, and some of its components. I ended up extending the app as suggested in the epilogue to use SQL Server tables over local storage with an external web service.
Amazon Verified review Amazon
George H. Mar 07, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Eli Geske has written an excellent introduction to the DHTMLX Suite. The writing is clear, specific, and easy to read, and the exercises are easy to follow. I didn't find any bugs in his code. I think that the documentation from DHTMLX can be daunting to even experienced programmers, so this book can really help you to learn how to think and code using the DHTMLX framework. If you take the time to type-in and test each exercise progressively and not just cut and paste them in, you will definitely have a big jumpstart in using DHTMLX.My only quibble with the book is that it did not give any examples of using data from a server-side database, but that really shouldn't be very difficult for people familiar with JavaScript and JSON to figure out.You will definitely need some familiarity with JavaScript and JSON to get the most out of this book, however, if you take the time to do all the exercises for building the application and pay attention to the patterns, you'll get a good idea about how JavaScript works.
Amazon Verified review Amazon
Steven Place Jan 31, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is a quick, step-by-step guide to installing and using this powerful JS library. Eli thoroughly explains every function in clear detail, making this the perfect manual for anyone who wants to create highly interactive web applications using the DHTMLX suite.Eli covers the entire suite, explaining every method and event in easy-to-understand language. Well done.
Amazon Verified review Amazon
Csaba Kiss Jan 30, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
I was very happy to see a book about DHTMLX. As far as I know, this is the first book about this JavaScript framework. It is aimed at beginners and gives you a good taste what the framework is capable of. The book is well structured and written well. It is easy to follow the instructions. I would definitely recommend it over the official documentation, which can be really confusing and frustrating from time to time. However, the DHMTMLX folks are really dedicated to help if you need it. I hope this book will help to spread DHTMLX, because I believe it is deserved to be used more widely.Unfortunately, the book does not follow the officially recommended directory structure. That can be confusing for beginners. However, if you can get over that, the website structure is very logical. The book introduces the reader to the most common components of DHTMLX. It does a very good job explaining the various methods and events of each component without overwhelming. All in all, the book is a great introduction to DHTMLX.The only sore point I have about the book is the use of HTML5's local storage. I think the author/publisher chose the easy way out of using local storage instead of a "real" sql database. Because of this, one crucial part of DHTMLX is missing, which is server side functionality. I believe that the majority of potential users of DHTMLX have a proper sql database. The connector files add a lot of functionality to DHTMLX that changes methods in many components of the framework (server-side sorting filtering etc.). I hope the next edition will include this as well.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.