jQuery, Sortables and Saving The Order
Quick post this one as the web dev type will clearly poke around the code (I want you to!) — this evening I have created some very quick but potentially very usable code that progressively uses Javascript to create a ’sidebar’ element on a webpage for widgets that you could change the order of, and potentially close or add to depending on your preferences.
http://www.sunshinesista.plus.com/worthing_test/sortables.html
This code creates a page and if Javascript is enabled creates the sidebar and a cookie that is stored on your PC for 7 days. This notice will pop up just so that privacy with regard to my code is transparent.
The sortables are then set up in this floating side bar and then you can re-order the examples and exit the page, browse away, whatever. When you come back, the order you created will be restored neatly.
By all means use it yourself
I know I will be… (I’ll add ‘remove/hide’ and ‘add’ code but that’s it)
Hope it’s useful. It uses jQuery, an absolutely superb Javascript library.



Thats really cool! I’ve used jQuery on a few things but I’ve just switched back to YUI for a project, it’s come a long way since I first used it over a year ago. Only thing is I have to keep going back to the docs, it’s quite a bit more verbose than jQuery, but very powerful.
Thom Shannon
March 10, 2008 at 10:47 am
YUI does look interest indeed, particularly what I have seen of it shown by you
I will probably revisit it but I have fallen for jQuery’s chainability of commands and its relative light download footprint. THe latter is a killer for me as the website this is for (shouldn’t take a genius if they put their mind to it…) requires a small download footprint.
So far at work the development of this is far in advance of this demo with all gadets being defined and loaded into the DOM via an XML configuration file. Layout is saved and gadgets can be coded in just plain HTML, Javascript, ASP or any other server side language. Needless to say Javascript is the most useful as you can kick in AJAX to back end server side scripting.
One downside is that I hadn’t realised but the sortables extension I’ve been using is the one now integrated into jQuery.ui; and this one is incompatible with jQuery certainly from v1.2.1 — so I’ve been inadvertently using an old jQuery version. I shall try to rectify this today…
I’ll drop you a URL privately as I cannot paste publically for you to see all this; I’ll e-mail it later
Thanks again!
lilserenity
March 14, 2008 at 8:20 am
Hi , It is awaesome……From where I can get code for this.
Ajay
June 9, 2009 at 7:10 am