I’m creating an iPhone web application, using the iUI framework to give it a look and feel similar to native iPhone apps.
More sortable tables
That script again. I needed to be able to trigger a sort onload. Posted this to the aforementioned blog as well, but I’ll keep it here for myself.
1 2 3 4 5 6 7 8 9 10 11 12 | //this function is passed the ID of one of the TH elements, and triggers a sort without a click function trigger_Sort(id) { var fakeEvent=new Object; fakeEvent.currentTarget=document.getElementById(id).firstChild; //comment out this block for ascending sort for (var i=0; i<fakeevent .currentTarget.childNodes.length; i++) { if (fakeEvent.currentTarget.childNodes[i].tagName) { fakeEvent.currentTarget.childNodes[i].setAttribute('sortdir','down'); } } ts_resortTable(fakeEvent); } |
//this function is passed the ID of one of the TH elements, and triggers a sort without a click function trigger_Sort(id) { var fakeEvent=new Object; fakeEvent.currentTarget=document.getElementById(id).firstChild; //comment out this block for ascending sort for (var i=0; i<fakeevent .currentTarget.childNodes.length; i++) { if (fakeEvent.currentTarget.childNodes[i].tagName) { fakeEvent.currentTarget.childNodes[i].setAttribute('sortdir','down'); } } ts_resortTable(fakeEvent); }
Sortable tables
Stuart Langridge came up with a script to sort your tables. I found it a bit limited, so I made a few modifications from a version I found at this blog.
Continue reading “Sortable tables”