• download
  • documentation
  • forums
  • demo
  • contact
  • blog

meteora

javascript widgets

Documentation

  • Autocomplete
  • Bubble
  • Calendar
  • Carousel
  • Datagrid
  • Dialog
  • Editor
  • Effect
  • Filebrowser
  • Form
  • Jsonrpc
  • Menu
  • Notebook
  • Picbox
  • Popup
  • Searchlist
  • Selection
  • Spinbutton
  • Tablesort
  • Toolbox
  • Treeview

What does this control do?

Allows any table to be sortable by columns.

For an usage example check out the Meteora.Tablesort demo.

How to use it

In order to be able to use this control, paste this line of javascript right at the beginning of your script tag:

Meteora.uses('Meteora.Tablesort');

In order for a table to be sortable, it should be built using thead and tbody tags.

<table id="table_id">
  <thead>
    <tr>
      <td>column 1</td>
      <td>column 2</td>
      <td>column 3</td>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>content 1.1</td>
      <td>content 1.2</td>
      <td>content 1.3</td>
    </tr>
    <tr>
      <td>content 2.1</td>
      <td>content 2.2</td>
      <td>content 2.3</td>
    </tr>
  </tbody>
</table>

Once you have created the table, the only thing you need to do is invoking the control this way:

new Tablesort('table_id');

Now if you click on a table column, the rows will be sorted according the values of the column.

Copyright © 2007-2009 Astrata Software.