This is the full source code from a StackOverflow Question that I made and answered myself.
A working demo can be found on JSBIN at http://jsbin.com/aliniz/2
The Question as well the Answer can be found on StackOverflow.
08 Jul 2013
v.1.3 - updated with latest versions of libraries; html refactored using JsRender;
03 Mar 2013
v.1.2 - Fixed links with working example as it was pointing to "latest" libraries;
29 Sep 2011
v.1.1 - Added GIT Repo; cleaned the code; update to latest framework versions;
11 Feb 2009
v.1.0 - First version from a need in a project;