JS Table Sorting for BBC Glow – v1.3 (Updated)

6

Posted by Rob | Posted in BBC Glow, Code, Javascript | Posted on 01-04-2010

Tags: , , ,

Morning all, I’ve recently started working for the BBC, and as such I’ve started working with the internal JavaScript framework, Glow.

So this is my first attempt at writing to some code with it. I hope it’s useful to someone. It’s just a simple JavaScript table sort.

The Introduction

Just a bit of useful script for client side sorting of tables. Simple click the headers of the columns, and it will arrange it in ascending order. A second click will arrange it in descending order.

UPDATE – 30th July 2010: After talking with a BBC colleague, it occurred to me that I could improve the code, so that it doesn’t rely on the class names for the ordering. The class names are now purely for decoration, not functionality.

UPDATE 2 – 30th July 2010: It was just pointed out by James (thanks man), that Glow/JS doesn’t handle number sorting brilliantly, so I’ve added a small patch to improve this. Thanks to James for his suggestion.

UPDATE 3 – 3rd August 2010: Some alterations to improve sorting of floats.

Read the rest of this entry »

2 people like this post.

Ajax Content for MooTools v1.2 (Facebook Style)

0

Posted by Rob | Posted in Code, Javascript, MooTools | Posted on 22-10-2009

Tags: , , , , ,

Welcome to my second attempt at writing up a mootools class. This one’s a little more advanced this time.

It attaches an Ajax handler to all links on a page which conform to the selector you give it. For example, you can tell it to attach to all standard links (<A HREF=’/here/’>Hello</A>), or links with a specific class as i’ve done with the code below (<A HREF=’/here/’ CLASS=’ajax’>Hello</A>).

I hope someone finds this useful. As ever this was created after I kept saying that I could write something a hell of a lot better than anything else I was finding. This might be a bold statement, but I was having trouble finding anything that would do the job, and simply.

Read the rest of this entry »

Moodal Window for MooTools 1.2.3.1

3

Posted by Rob | Posted in Code, Javascript, MooTools | Posted on 24-09-2009

Tags: , , ,

MoodalWindowThis is my first attempt at publishing one of my scripts, and my first real attempt at writing a MooTools class.

I hope you enjoy it, and check out the demo:
Read the rest of this entry »

1 person likes this post.