Skip to Content Skip to Menu

Make CB Lists Sortable...it can be done...woohooo!

  • Raj
  • Raj
  • OFFLINE
  • Posts: 191
  • Thanks: 0
  • Karma: 30
18 years 3 months ago #16880 by Raj
So i found this sortable tables script at www.kryogenix.org/code/browser/sorttable/ and I thought, "I wonder if I could apply that to CB Lists?"

Turns out, it works.

Here are the steps:

1. get sorttable.zip from www.visionsimulations.com/sorttable.zip . Unzip it and upload it to your joomla root.

2. in the head of your template, add:
<script src="sorttable.js"></script>

3. also in the head of your template, add:
<script type="text/javascript">
function makeSortable() {
if (document.getElementById("cbUserTable")) {document.getElementById("cbUserTable").className = "sortable"}
sortables_init();
}
</script>

4. in the body tag of your template, add the onload event to call the makeSortable function, like so...
<body onload="makeSortable()">

That's it!

I don't know what happens when different lists are chosen from a dropdown...my site only has one CB List. Can someone report?

Also, you'll need to edit the ectiontableentry1 and ectiontableentry2 classes in your template CSS to be the same background, or write/find some javascript to redo the alternate row colors once the sort is done. This shouldn't be too hard...I just haven't explored doing it yet.

Roger

Post edited by: Raj, at: 2006/07/11 10:55
Attachments:

Please Log in or Create an account to join the conversation.

  • nant
  • nant
  • OFFLINE
  • Posts: 12339
  • Thanks: 1467
  • Karma: 877
18 years 3 months ago #16881 by nant

Please Log in or Create an account to join the conversation.

  • Himgoku
  • Himgoku
  • OFFLINE
  • Posts: 11
  • Thanks: 2
  • Karma: 1
18 years 2 months ago #17465 by Himgoku
Does't work on my site :(

The script should add a unique id and a sortable class to my CBList table, but it doesn't...

I really would like this functionality on my site though....

Hope you've got any suggestions.

regards,

Himgoku

CB 2.0 RC
Joomla 3.3.3

Please Log in or Create an account to join the conversation.

  • Raj
  • Raj
  • OFFLINE
  • Posts: 191
  • Thanks: 0
  • Karma: 30
18 years 2 months ago #17466 by Raj
Check this out:

extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,326/Itemid,35/

This guy has a great solution to querying CB tables and producing search results, and he's using the same sortable table javascript that I happened to find and wrote about above.

Unfortunately, there's a bit of a learning curve with DBQ, but if you do learn it, you can apparently use it to set up a search form. So...you get a search form AND sortable tables.

I hope to learn how to do this next week.

Roger

Please Log in or Create an account to join the conversation.

  • m2media
  • m2media
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
18 years 2 months ago #17892 by m2media
After following the directions of your post I recieved a "No users in this list" When I went to view my members.

- Jason

Please Log in or Create an account to join the conversation.

  • m2media
  • m2media
  • OFFLINE
  • Posts: 3
  • Thanks: 0
  • Karma: 0
18 years 2 months ago #17895 by m2media
After following the directions of your post I recieved a "No users in this list" When I went to view my members.

- Jason

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum