aql::grid()
From SkyPHP
Display a HTML data grid using data from the database. Ajax pagination and sorting is supported.
Contents |
Description
array grid ( array $keys )
array grid ( string $aql [, string $columns [, array $clause [, array $options ] ] ] )
array grid ( string $model [, array $columns [, array $clause [, array $options ] ] ] )
Parameters
keys - single parameter array. all values are strings unless otherwise specified
- model | aql (required)
- columns | cols (required, see components)
- where (array or string)
- offset
- limit
- order by | orderby | order_by
- clause_array | clause
- options | param
- any of the individual "options" below can be keys
aql - the aql statement to execute
columns - the columns to be displayed on the grid
clause - additional clauses to inject into the aql statement (see clause array)
options - array of additional options
- rs_callback
- table_class
- max_rows
- enable_sort
- no_pagination
- no_matches_text
- form
- row_onclick_function_name
- on_reload_function
- no_ajax_pagination
Return Values
n/a
Examples
$aql = "album {
name as album_name,
year,
duration
}
artist {
name as artist_name
where name = 'Pink Floyd'
}";
$col = "artist_name {
label: Artist;
font-size: 20px;
}
album_name {
label: Album;
order by: album.sort_name;
}
year {
label: Year;
align: right;
hide: true;
}
duration {
label: Duration;
total: true;
}";
aql::grid( $aql, $col );
See Also
Known Bugs & Issues
- ajax pagination & ajax sorting should have graceful fallback to non-ajax (SEO compatibility)
- sorting should work for aql grids not just model grids
- remove sorting icons -- click column header and have small arrow to indicate asc|desc
- row form is not valid html compliant
- setting $param in a component causes problems
- ability to pass clause array values directly instead of in the clause param
- "hide" column attribute does not work
- don't let the columns scroll off the top of the page
- edit button should post array of primary_table_ide's so the profile page can have next|prev
- pagination: make nicer buttons, show total # records & pages, go to page # dd
