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 Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
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
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

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 : 9781849699334

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
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

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

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

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

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela