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 a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781849699334

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

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 included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.