An open API service indexing awesome lists of open source software.

https://github.com/j7mbo/ajaxtable

OOP JavaScript / jQuery class for handling dynamic data via ajax within tables.
https://github.com/j7mbo/ajaxtable

Last synced: 2 months ago
JSON representation

OOP JavaScript / jQuery class for handling dynamic data via ajax within tables.

Awesome Lists containing this project

README

        

AJAXTable
=========

OOP JavaScript / jQuery class for handling dynamic data via ajax within tables.

AJAXTable makes it easy to update a table's rows with elements retrieved via AJAX, updating those rows that already exist with new data, and prepending new rows to the table with smooth jQuery animations.

You can view the current example working [here](http://jsbin.com/obixoj/1).

Examples
========

**HTML**




id

value





old id

old value



**JavaScript**

$(document).ready(function()
{
// Point to a table you have in the DOM
var table = new AJAXTable.Table('js-table');

// Update the row with the id "one"
var row = new AJAXTable.Row('one');
row.addCell(new AJAXTable.Cell('new id'));
row.addCell(new AJAXTable.Cell('new value'));
row.addCell(new AJAXTable.Cell('ignored cell'));
table.addRow(row);

// Add a new row with the id "two"
var row2 = new AJAXTable.Row('two');
row2.addCell(new AJAXTable.Cell('brand'));
row2.addCell(new AJAXTable.Cell('new cell'));
row2.addCell(new AJAXTable.Cell('ignored cell'));
table.addRow(row2);

// Render the table changes
table.render();
});