pax.widget.datagrid

This is a datagrid widget, that can render in various ways

Author

Mikkel Bergmann, http://www.pointful.com

Summary
pax.widget.datagridThis is a datagrid widget, that can render in various ways
Functions
pax.widget.datagrid.initInitialises a grid for ajax loading
pax.widget.datagrid.templateReturns a PAX template for the datagrid

Functions

pax.widget.datagrid.init

Initialises a grid for ajax loading

Parameters

targetan element to render the grid into
argsarguments for the grid widget
  • url - Data loading URL
  • rowClick - A function we fire on row click
  • itemClick - A function we fire on item click
  • offset - Data index offset
  • limit - Data row limit
  • pageNumberLimit - Limit of how many pages to show before using dots, ie: “...”
  • sortDirection - The sort direction variable name sent to the server
  • reverseSortDirection - The reverse direction sort variable name sent to the server
  • ignoreCols - Columns to ignore in the display
  • applyCols - Templates to apply to items in a column
  • filterCols - Templates to apply to the filter header, this is work in progress
  • colName - Column name override
  • colWidth - Optional width of each column
  • colWidthDefault - Default column width
  • colAlign - Optional alignment of each column, use column name: [left, right, center]
  • width - Width of the grid - automatically grows if not specified, use pixels only
  • height - Height of the grid - if not specified, grid won’t scroll, use pixels only
  • showHeader - If we want to show the header.
  • showFooter - If we want to show the footer.
  • showSearch - If we want to show the search box
  • data - The data in the grid

Returns

nothing

Example

<div id='widget.datagrid.init.example1'></div>
[:.
    var args = {
        url: '/pax/documentation/pax.widget.example.table.php',
        limit: 10,
        ignoreCols: [ 'notes' ],
        colWidth: { id: '30px', name: '30%', country: '30%' },
        sort: 'name'
    };

    pax.widget.datagrid.init( $('widget.datagrid.init.example1'), args );
:]

This example sets up a simple ajax data grid, getting the data from the given php file.  See the data grid demo for a live demo: http://paxjs.com/demo_data_grid.htm

pax.widget.datagrid.template

pax.widget.datagrid.template = function(grid)

Returns a PAX template for the datagrid

pax.widget.datagrid.template = function(grid)
Returns a PAX template for the datagrid
Close