Places

 

  • Download
  • Documentation
  • Forums
  • Demo
  • Contact
  • Blog
  • My account

Meteora

Javascript Widgets

Controls

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

Features

  • JsonRpc Core

Effects

  • Visual effects

Control.Tablesort

Before proceeding you may want to read our getting started page.

What does this control do?

Allows any table to be sortable by columns.

For an usage example check out the Control.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('Control.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.

Powered by textmotion

(c) 2008 Astrata Software