Book Image

Building UIs with Wijmo

By : Yuguang Zhang
Book Image

Building UIs with Wijmo

By: Yuguang Zhang

Overview of this book

Until recently, writing applications using JavaScript and HTML was difficult, because developers had to make the user interface by themselves; however, this started changing with the introduction of JavaScript libraries such as jQuery, jQuery UI, and KnockoutJS. An extension of jQuery UI, Wijmo adds features and widgets on top of jQuery UI and makes it easier to add user interface widgets to HTML documents. Building UIs with Wijmo gives you a tour of what Wijmo offers at a glance. With code recipes and well-explained examples, you will be able to use Wijmo in no time. The book gives details on options not explained in the documentation and helps you avoid those that don't work. The examples only feature the necessary code, with recommendations and best practices. This book introduces Wijmo, grouping widgets by their common application area or usage. It walks the user through the features of the dialog widget with examples as an introduction to the library. Then, widgets for forms, images, tootips, and other topics are explored. Features only available in the Wijmo dialog widget compared to the jQuery UI widget are thoroughly explained with examples. Common form components such as checkboxes, dropdowns, and inputs have Wijmo counterparts which keep the theme consistent and add functionalities. When Wijmo is used with Knockout, the UI automatically refreshes when the data changes. This book takes it further with WebSockets for two way communication between the server and client. With Building UIs with Wijmo, you will learn all the common web development components in Wijmo. You will get started using Wijmo in no time.
Table of Contents (15 chapters)

Preface

Wijmo is a new JavaScript library focusing on user interface widgets. It builds on jQuery UI, enhancing existing widgets, and adding new ones. In this book we examine the Wijmo widgets essential for web development. The useful configuration options for 15 widgets are covered along with their usage scenarios. Most of the chapters take a code recipe approach for tasks that occur often in web development. Whenever you come across a widget or user interface component that you've implemented before, chances are that Wijmo widgets have you covered. The chapters in this book are designed to get you started using the widgets in no time. On the other hand, Chapter 6, Dashboard with Wijmo Grid, takes a different approach in building an application and explaining how it works.

There is no need for going in sequence of the chapters if you're familiar with Wijmo. However, if you're experiencing Wijmo for the first time, I would recommend going in the same order as the chapters.

What this book covers

Chapter 1, Getting Started with Wijmo, introduces Wijmo, the steps to install it, and licensing.

Chapter 2, The Dialog Widget, explains Wijmo's features that can be added to the jQuery UI dialog widget.

Chapter 3, Form Components, examines the Wijmo widgets for forms.

Chapter 4, Working with Images, shows the common uses of the gallery, lightbox, and carousel widgets.

Chapter 5, Advanced Widgets, covers the tooltip, upload, video, and editor widgets.

Chapter 6, Dashboard with Wijmo Grid, builds an interactive application combining Knockout and Wijmo.

Chapter 7, Wijmo Mobile, sets up the development environment for mobile and introduces mobile views.

Chapter 8, Extending Wijmo, explains how to modify widgets and change the themes.

What you need for this book

You will need a text editor with JavaScript, CSS, and HTML syntax highlighting. Notepad++ on Windows or Textmate on Mac is sufficient. Developing with Wijmo does not require fancy editor features, such as auto-complete or warnings for JavaScript. The widgets are simple and easy to use.

Besides a text editor, you also need a web browser. An Internet Explorer version higher than Version 5, Firefox, Safari, or Chrome are all supported by Wijmo. You probably already have one installed and prefer one over another.

Who this book is for

The primary audience for this book are the web developers working on projects that require the use of ready-made widgets. jQuery UI lacks necessary components or features, whereas Wijmo provides both free, open source widgets, as well as a licensed option for more complex widgets. Since this book covers both the areas, developers working on open source projects can also benefit.

Since Wijmo is easy to use, many of the simpler examples can be understood by a beginner with JavaScript. When the previous condition is met, this book is the first book that a JavaScript beginner should read after learning jQuery. Learning how to use Wijmo widgets will reduce the unnecessary work of writing custom JavaScript.

Conventions

In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The widget method returns the dialog HTML element."

A block of code is set as follows:

$("#dialog").wijdialog({captionButtons: {
  pin: { visible: false },
  refresh: { visible: false },
  toggle: { visible: false },
  minimize: { visible: false },
  maximize: { visible: false }
  }
});

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

maximize: {visible: true, click: function () {
  alert('To enlarge text, click the zoom icon.')
}, iconClassOn: 'ui-icon-lightbulb'},
close: {visible: true, click: self.close, iconClassOn:'ui-icon-close'}

New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes, for example, appear in the text like this: "clicking the Next button moves you to the next screen".

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.

To send us general feedback, simply send an e-mail to , and mention the book title via the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.

Piracy

Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors, and our ability to bring you valuable content.

Questions

You can contact us at if you are having a problem with any aspect of the book, and we will do our best to address it.