JavaScript API Reference/Ab.grid.ReportGrid object

new Ab.grid.ReportGrid(controlId, configObject)

The constructor sets up a data structure in memory that is used to build the ReportGrid. Note that it does not actually modify the DOM or place a report on the page.

Parameters:

  • controlId (String): identifier matching the id of a DOM element in the page (typically a <span> or <div> ) to which the resulting grid will be appended;
  • configObject (JS object): collection of configuration parameters for setting up the grid. A map whose keys are used to set up the component;
    • viewDef (String or object) can be the view name as a string or an Ab.view.ViewDef object containing the following properties:
      • viewName (String): name of the AXVW view. If this is the empty string, tableName and fieldNames can describe the refresh parameters;
      • tableGroupIndex (integer): a zero-based index to the panel containing this ReportGrid within the view’s afmTableGroup;
      • tableName (String): the main database table containing the fields in the following property. Not used when viewName is not null;
      • fieldNames (array of strings): the column names necessary for refetching data from the server. Names should be in table-dot-column form.
    • groupIndex (integer): a zero-based index to the panel containing this ReportGrid for views with multiple table-groups (used only in version 1.0 views);
    • sortColumnID (optional String): the id, in table-dot-column form, of the column on which the report is initially sorted;
    • cssClassName (optional String): the CSS class used for styling the ReportGrid;
    • showOnLoad (optional boolean): whether the ReportGrid should be constructed and data fetched form the server when the page initially loads rather than waiting for the load to be initiated by another control in the window;
    • selectionEnabled (optional boolean): allow selection (highlighting) of rows; by default row selection is enabled.
    • multipleSelectionEnabled (optional boolean): insert a selection column into the ReportGrid, typically a checkbox, that allows one or more row to be selected;
    • useParentRestriction (optional boolean): when fetching data, use the restriction from the parent element such as from a tabbed panel;
    • refreshWorkflowRuleId (optional String): use a different workflow rule from the system designated one;
    • sortAscending (optional boolean): initially show the rows sorted in ascending order (the default) based on the column with id sortColumnId ;
    • maxCellContentWidth (optional integer): the maximum width of a grid cell's content, beyond which content is shortened to ellipses & whole content is shown in tooltip. Particularly applicable to memo fields. Default is 50.


Example


Construct a configuration object and use this to construct a ReportGrid:

var config = {'viewDef': viewDefObj, 'showOnLoad': 'false'};
var grid = new Ab.grid.ReportGrid ('rm_div', config);