dGraph: a layered directed graph libray for the web

If you ever needed to visualize hierarchical data with JavaScript in the browser, the library dGraph will help you out. It will draw a layered directed graph as SVG based on the Sugiyama algorithm. Checkout dGraph from GitHub.

Quick tip: How to document a dojo AMD module for JSDoc 3

Unfortunately, JSDoc 3 does not fully support documenting AMD style modules that return a declare function, e.g.: define([‘dojo/_base/declare’], function(declare) { … return declare([], { … }); }); But with a bit of verbosity each module and the class will be properly documented:

How to Generate JavaScript Documentation with JSDoc 3 and PhpStorm

This guide is outdated. I wrote the new tutorial Use JSDoc 3 and PhpStorm to generate JavaScript documentation This is an update to my previous article How to create JavaScript documentation in PhpStorm, since the JsDoc Toolkit is no longer under active development. It got replaced by JSDoc 3, with better support for current coding …

Changing cursor to wait while request is in progress

Switching cursor to ‘wait’ and back to ‘default’ is tricky since some elements such as link, input or button have a different default style. Setting it back to ‘auto’ does not work in Firefox, but to an empty string works. Here’s how you would do it with dojo: require([‘dojo/_base/connect’, ‘dojo/query’], function(connect, query) { // change …

REST with dojo and PHP: Notes on using dgrid with a caching store

I would like to share some (personal) pitfalls I came across when creating the demo REST with dojo and PHP: Demo of a dgrid observing changes to the JsonRest store: dojo/store/Observable only works correctly when the object has an id. Unfortunately, dojo/store/Memory.add(object) does not add the id to the object when creating it (as of …

Yay, my first patch to the dojotoolkit got checked in !

While I’ve been working on my remote file explorer I noticed that the dijit tree remembers the state of opened/closed nodes but not of selections. So I filed a bug and created a patch, which got checked in yesterday.

Why I love PhpStorm: SQL table aliases

Here’s another example for the reason why I like JetBrains PhpStorm so much: SQL code assist in the Database Console completes statements either in upper case or lower case depending on how you started typing, not to speak of understanding aliased tables when suggesting column names after typing a dot. More PhpStorm love: SQL GROUP …

Dojo Demo: Multiple file uploading with pause/resume

Update 09.2013: You can also use the file picker (file input) now. I implemented a demo of a file uploader with dojo and PHP that lets you upload multiple files at once with drag and drop. The upload of each file can be paused/resumed thanks to the slice method of the new Blob interface. Download: …

Creating a ‘blocking’ confirm dialog with dojo

Update 30.03.2018: Version 1.10 of dojotoolkit includes a dijit/DialogConfirm now, which is simply a dijit/Dialog featuring ‘OK’ and ‘Cancel’ buttons, no blocking though. Update 15.10.2012: Code is available on githup now. I also fixed updating the content of the dialog after creation (e.g. dialog.set(‘content’, newContent) overwrote the confirm/cancel buttons because they were part of the …

phpStorm and documenting JavaScript

I’m awed again and again by phpStorm‘s features. I just came across this one: When I comment my JavaScript methods/functions with the @param, all IDEs I have tried out so far, let you only set a primitive type in curly braces, e.g.: /** * Some method description. * @param {Object} deferred dojo.Deferred */ someMethod: function(deferrede) …