Snack
Javascript snack: enable both click and doubleclick events on one element
Thursday, May 10th, 2012HTML defines onClick and onDblClick event handlers on all elements. However, if you want to enable both on the same element, something goes wrong. the onClick event gets fired twice! And that is not what we want, so here’s a little Javascript to fix that: // use these functions to enable *both* onclick and // [...]
Javascript snack: new Date() with time zone
Thursday, February 9th, 2012To set a time, use the (very convenient) Dat eobject: var now = new Date(); If you want to set a certain date, use: var someDate = new Date(“yyyy-mm-ddThh:mm:ss+hh:mm”); e.g.: var someDate = new Date(“2012-05-17T00:00:00+02:00″); For May 17th, 2012 00:00:00, CEST. Notice (and I just found that out), not all browsers take the same timezone [...]
Android-dev-snack: what if R.id. doesn’t seem to be right anymore?
Tuesday, November 1st, 2011
In Eclipse, with the ADT plugin for Android development, what to do if your widget-IDs seem to be all over the place? What if that TextEdit suddenly seems to have jumped over two TextView widgets? Simply running a “Clean project” fixes it. It seems to be triggered by a lot of dragging, dropping and cutting [...]
Websnack: dijit.form.Select vs dijit.form.ComboBox
Friday, September 16th, 2011If you create a dijit.form.Select with a lot of items, it will become slow and render through the end of the page (no scrollbars). Instead, use a dijit.form.ComboBox; it is fast and renders correctly. It doesn’t necessarily need a itemstore, a HTML <select> list works perfectly fine. Just add dojoType=’dijit.form.ComboBox’ and you’re done. Note: this [...]