tgrid v. 0.0.2 is ready to download
I have introduced a small upgrade to the class after suggestions from Alex and David - thanks, guys!
The main difference is that You can use __defined_cols as the actual rendering dictionary (previously it was used to put the list of displayed columns out of the sql query result but there was no way to provide custom columns, which did not belonged to the query). This means that now there is no need to select null columns in the sql query (in order to create artificial columns). You just create another entry in the dictionary and provide some renderer. Here's how:
function myModel(id)
{
this.id = id;
this.__defined_cols = ["first_name","last_name","team", "my-custom-column"];
this.renderes = {
"my-custom-column": function(x, r) { return "You can use the whole record here: "+r["first_name"]; }
}
//...
}
The important thing to remember is also that by this change You can define the order in which the columns will appear in the grid.
There was also a bug in the pagination
tgrid v. 0.0.1 is ready to download
This was the initial release.
News :
tgrid v. 0.0.2 released.
tgrid v. 0.0.1 released.
Download :
- tgrid.zip (tgrid v. 0.0.2)