Blog

Aug 27

Dojo FAQ: How can I create dependent or linked select controls using Dijit?

By on August 27, 2014 10:09 am

DojoFAQ

When building a select control in a form there are times where its available options need to change dynamically in response to a change in another control. For instance, a form with both country and state/province select controls might require the options in the state select to change based on the country select’s current selection. This is what we would call a dependent, or linked, select. One way to accomplish this is by watching changes in the selection state of one select and finding and setting the appropriate selection values on the other.

The selection values of Dijit Select widgets can be provided as an array of options objects or a dojo/store instance. We will walk through an example creating a dependent select for both types of source data.

Aug 25

dgrid 0.3.16 is born!

By on August 25, 2014 1:40 pm

dgrid 0.3.16 has been released!  It includes the following improvements:

  • Various improvements to keyboard accessibility, including interoperation with the ColumnSet mixin and editor column plugin
  • Additional ARIA attributes for improved accessibility in the ColumnHider and Pagination extensions
  • Improvements to logic for drag-and-drop operations with DnD extension

More information on dgrid 0.3.16 is available in the release notes.

We are working hard on our next release, dgrid 0.4!

Aug 22

Advanced TypeScript concepts: Classes and types

By on August 22, 2014 8:38 am

While TypeScript is very simple to understand when performing basic tasks, having a deeper understanding of how its type system works is critical to unlocking advanced language functionality. Once we know more about how TypeScript really works, we can leverage this knowledge to write cleaner, well-organised code.

If you find yourself having trouble with some of the concepts discussed in this article, try reading through the Definitive Guide to TypeScript first to make sure you’ve got a solid understanding of all the basics.

Aug 20

SitePen Unplugged 2014: A face-to-face adventure

By on August 20, 2014 9:31 am


SitePen is a rather unique company. For those of you who don’t already know, everyone in our company works from home. We are all spread across the United States. Despite that, the magic of our culture is that we feel closer to our coworkers at SitePen than at our previous office-based jobs. How is that even possible?!? We have grown together (think Katamari Damacy) through phone and online conversations and the virtual office we share is a very real thing for us. However, as a result, most of us haven’t seen each other’s faces before. Unplugged was a treat for everyone as it gave us a week to indulge in the opposite end of the social spectrum. No electronic devices, only face to face interactions and (gasp! frightening, I know) eye contact! Hey seriously, stop looking at the floor… I’m up here!

Leading up to the Unplugged event itself, nobody knew exactly what we were getting ourselves into. We only knew that we signed a few scary waivers, there would be rafting, no electronic devices, and that our flights were taking us all to Colorado on the same day. Suspense and intrigue leading into a new, shared adventure!

Aug 13

Dojo FAQ – How do I use Bootstrap with Dijit?

By on August 13, 2014 12:15 pm

DojoFAQ

Bootstrap is a framework created by Twitter’s developers to consolidate their HTML/CSS design and widgets. Bootstrap provides a clean responsive design, but the set of widgets it includes is limited, especially when compared to what’s available in the Dijit library. The CSS/HTML theme can be used independently of the widgets, but how do you use the Bootstrap theme with the Dijit library?

As you may have guessed, it’s not quite as simple as including the relevant Bootstrap CSS files. However, Dijit supports custom themes, so with a bit of work the elements of the Bootstrap theme could be ported to Dijit widgets. Fortunately, this was just what the dbootstrap project set out to accomplish.

For a better idea of what this Dijit/Bootstrap marriage looks like, check out the dbootstrap gallery, a modified version of Dijit’s Theme Tester that also includes dgrid. Let’s take a closer look at dbootstrap and how to use it in your Dojo application.

Jul 30

Dojo FAQ: Why do I need to use an HTTP server with Dojo?

By on July 30, 2014 11:52 am

DojoFAQ

When developing for the web, it is a recommended best practice to always test your application during development with a web server. This is for two primary reasons. By running a web server, you can approximate a production environment similar to how your application will be served to your users. Also, browsers implement a same-origin policy that is different for quasi-protocols like file://. Many of Dojo’s modules like dojo/i18n, dojo/text, Dijit templates, and dojox/gfx depend on loading files from the same origin.

Jul 16

Dojo FAQ: When should I provide callbacks to dojo/when?

By on July 16, 2014 12:04 pm

DojoFAQ

In JavaScript it is common to use a Promise as a placeholder for a value which will eventually be provided upon completion of some operation. However most JavaScript methods run synchronously and immediately return a value. Dojo’s when module provides a transparent way to apply callbacks to either values or promises. It can do this in one of two ways:

  • Using when(value) to always create a promise
  • Passing callbacks to be applied directly to the value
Jul 11

Testable code best practices

By on July 11, 2014 12:03 pm

Many of the best practices for writing testable code also conform to general code best practices. Code that is easily testable often also tends to be highly maintainable and resilient against changing business requirements. This blog post provides a brief overview of key criteria for writing highly testable code.