Tag Archives: javascript

Deferreds in loops and recursive functions (Dojo)

When working with deferreds it sometimes is not that easy and intuitive as I thought. If you don’t know perfectly well how the deferreds work, then a little mistake can destroy all the fun you can have with deferreds … and bring you headaches.

Most of the times you probably will use deferreds that are easy to handle, like in the following example:

So in this case you simply create a new deferred object and return its promise to the caller. When the remote call or whatever delays your execution, is finished, the deferred gets resolved and the caller can continue.

Read more... (241 words, estimated 58 secs reading time)

Posted in Javascript / HTML / CSS | Tagged , , | 1 Comment

Add DoubleClick behaviour to ng-grid

If you want to react when double-clicking on a row of a ng-grid in AngularJS, then you can do the following:

  1. Add the following Javascript-File to some dir accessible from your app and don’t forget to load it during startup.

  2. Define a function to handle the double-click and update the grid-options as shown here:

And now have fun :)

 

 

Posted in AngularJS, Javascript / HTML / CSS | Tagged , | 10 Comments