Constructor
new module:ct-grid /Grid View(grid Definition, grid Row Model, grid Column Model, grid Decorators)
Constructs a new GridView
with the specified arguments.
This constructor should not be called directly, but instead
module:ct-grid/GridComponentFactory
should be used for the construction of all
grid assemblies.
Parameters:
Name | Type | Description |
---|---|---|
gridDefinition |
module:ct-grid |
The compiled XML definition of this grid. |
gridRowModel |
module:ct-grid |
The row model to be displayed by this grid. |
gridColumnModel |
module:ct-grid |
The column model to be displayed by this grid. |
gridDecorators |
Array |
The GridDecorator instances to be applied to this grid. |
Methods
add Column Header Renderer Listener(listener)
Adds an module:ct-element/RendererEventListener
listener to the grid view.
Any events raised on any of the renderers on the GridView will raise an event.
Use module:ct-grid/GridView#removeColumnHeaderRendererListener
to remove a listener.
Parameters:
Name | Type | Description |
---|---|---|
listener |
module:ct-element |
The listener to listen to for renderer events. |
add Grid View Listener(grid View Listener)
Adds a listener to the grid view, to be communicated of all grid level events.
Parameters:
Name | Type | Description |
---|---|---|
gridViewListener |
module:ct-grid |
The grid view listener to add. |
add Renderer Event Listener(renderer Event Listener)
Adds a RendererEventListener to listen to any of the events that occur on renderers in the GridView.
Parameters:
Name | Type | Description |
---|---|---|
rendererEventListener |
module:ct-element |
the listener to add. |
can Receive()
can Receive Multiple Objects()
can Receive Objects()
get Cell Element(row Index, column Index) → {HTMLElement}
Returns the cell for the specified row and column.
Parameters:
Name | Type | Description |
---|---|---|
rowIndex |
integer | The row index of the cell |
columnIndex |
integer | The column index of the cell |
Returns:
The DOM element the cell is being rendered within.
- Type
- HTMLElement
get Cell Renderer(row Index, column Index) → {module:ct-element /Renderer}
Returns the cell renderer responsible for rendering the given row and column indices.
Parameters:
Name | Type | Description |
---|---|---|
rowIndex |
integer | The index of the row for which the cell renderer will be returned. |
columnIndex |
integer | The index of the column for which the cell renderer will be returned. |
Returns:
the cell renderer responsible for rendering the given row and column indices
get Container() → {module:ct-component/c ontainer /Container}
Returns a reference to the container that is hosting this component. If no container has been set then this will return undefined.
- Implements:
- Deprecated:
- Yes
Returns:
oContainer The container hosting this component.
- Type
-
module:ct-component
/container /Container
get Element() → {HtmlEl ement}
Invoked when the windowing environment needs to display this component. It returns the HTML
element that must be added to the DOM to represent this component. getElement()
is invoked before any of the other Component
interface methods.
This method is compulsory, and must be implemented.
It should be designed execute quickly, as the windowing environment may freeze until it has returned.
- Implements:
Throws:
-
if this method is not implemented by the subclass.
- Type
-
module:ct-core
/Error
Returns:
The root HtmlElement
used to display this component on a web page.
Must not be null
or undefined
.
- Type
-
Html
Element
get Element Indicies(element) → {Map}
Returns the map containing the row and column indices (rowIndex
and columnIndex
respectively) for the specified cell element.
If the specified cell represents a header, only a columnIndex
will be returned within the map.
Parameters:
Name | Type | Description |
---|---|---|
element |
HTMLElement | The cell element for which the indices are required. |
Returns:
A map containing the rowIndex
and columnIndex
for the given element.
- Type
- Map
get Grid Column Model() → {module:ct-grid /Grid Column Model}
Returns the underlying column model being used with the grid.
Returns:
The column model.
get Grid Decorators() → {Array}
Returns the decorators held by this Grid View
Returns:
The decorators held by this Grid View
- Type
- Array
get Grid Definition() → {module:ct-grid/G rid Definition|Grid Definition}
Returns the compiled XML definition of this grid.
Returns:
the compiled XML definition of the grid.
- Type
-
module:ct-grid
/Grid Definition | Grid Definition
get Grid Row Model() → {module:ct-grid /Grid Row Model}
Returns the underlying row model being used with the grid.
Returns:
The row model.
get Grid Row Selection Model() → {module:ct-grid /Grid Row Selection Model}
Returns the row selection model being used with the grid.
Returns:
The row selection model.
get Header Cell Element(column Index) → {HTMLElement}
Returns the header cell for the specified column.
Parameters:
Name | Type | Description |
---|---|---|
columnIndex |
integer | The column index of the cell |
Returns:
The DOM element the given header cell is rendered within.
- Type
- HTMLElement
get Header Renderer(column Index) → {module:ct-element /Renderer}
Returns the header renderer responsible for rendering the given column index.
Parameters:
Name | Type | Description |
---|---|---|
columnIndex |
integer | The index of the column for which the header renderer will be returned. |
Returns:
the header renderer responsible for rendering the given column index
get Header Row Element() → {HTMLElement}
Returns the header row.
Returns:
The DOM element the header row is rendered within.
- Type
- HTMLElement
get Last Receive Failure Message()
get Number OfDisplayed Rows() → {integer}
Returns the number of rendered rows visible in the grid at the present point in time.
Returns:
The number of currently displayed rows.
- Type
- integer
get Number OfDisplayed Rows() → {integer}
Returns the number of rendered rows visible in the grid at the present point in time.
Returns:
The number of currently displayed rows.
- Type
- integer
get Permission Key() → {module:ct-services /security /Permission Key}
Invoked so the container can determine whether the component is currently permissioned for use.
- Implements:
Returns:
-
The set of permissioning information that can be used to query
module:ct-services/security/PermissionService#canUserPerformAction
. -
The permission key
get Renderer Types() → {Array}
Returns an array containing all Renderer Types for every column.
Returns:
all renderer tpyes for every column
- Type
- Array
get Renderer Types Indexed ByColumn Name() → {Map}
Returns a map containing all Renderer Types for every column, indexed by column friendly name.
Returns:
all of the renderer types for every column.
- Type
- Map
get Row Container Element() → {HTMLElement}
Returns the grid row container element.
Returns:
The DOM element the rows are being rendered within.
- Type
- HTMLElement
get Row Element(row Index) → {HTMLElement}
Returns the row element with the specified row index.
Parameters:
Name | Type | Description |
---|---|---|
rowIndex |
integer | The row index |
Returns:
The DOM element the given row is rendered within.
- Type
- HTMLElement
get Start Index() → {integer}
Returns the index representing the first row in the grid.
Returns:
the index representing the first row in the grid.
- Type
- integer
get Success Message()
get Total Row Count() → {integer}
Returns the total number of rows in the dataset.
Returns:
The total number of rows.
- Type
- integer
get Unique Component Id() → {string}
Gets a guaranteed ID for this component instance.
Returns:
A unique ID
- Type
- string
get Visible Row Count() → {integer}
Returns the number of visible, populated rows in the grid.
Returns:
The number of visible rows.
- Type
- integer
is Column InView(column Index) → {boolean}
Determines whether the specified column is in view.
Parameters:
Name | Type | Description |
---|---|---|
columnIndex |
integer | The column index corresponding to the column |
Returns:
true
if the column is in view, and false
otherwise.
- Type
- boolean
is Row InView(row Index) → {boolean}
Determines whether the specified row is in view.
Parameters:
Name | Type | Description |
---|---|---|
rowIndex |
integer | The row index corresponding to the row |
Returns:
true
if the row is in view, and false
otherwise.
- Type
- boolean
is Scrolling() → {boolean}
Test if the grid is currently being scrolled.
Returns:
true if the grid is currently being scrolled.
- Type
- boolean
is Sortable()
The grid is sortable, unless it is empty.
mark AsDirty()
Calling this method will inform webcentric that the user's layout has changed. The layout will be marked using a *, informing the user that they must save their sheet to save any changes that have been made.
on All Data Received()
- Implements:
- See:
on Columns Added()
- Implements:
- See:
on Columns Removed()
- Implements:
- See:
on Filters Changed()
- Implements:
- See:
on Renderer Event(renderer, renderer Event, options)
The callback function to receive Renderer events.
Parameters:
Name | Type | Description |
---|---|---|
renderer |
module:ct-element |
The renderer raising the event. |
rendererEvent |
Map | The renderer event |
options |
Map | The event parameters |
- Implements:
- See:
on Row Contents Changed()
- Implements:
- See:
on Row Data Unavailable()
- Implements:
- See:
on Row Structure Changed()
- Implements:
- See:
on Scroll()
- See:
-
- module:ct-grid/scroll/ScrollPaneListener#onScroll
on Scroll Complete()
- See:
-
- module:ct-grid/scroll/ScrollPaneListener#onScrollComplete
on Size Changed()
- Implements:
- See:
on Sort Column Changed()
- Implements:
- See:
on Start Index Changed()
- Implements:
- See:
on Width Changed()
- Implements:
- See:
recalculate Heights()
Inform the grid that the styling applied to the grids has dynamically changed, affecting the current column header and/or rows heights.
Some uses of the grid may involve changing the display mode at runtime, so that the column headers or the rows themselves have a different height in these different modes. Although a display mode switch may be affected by the developer by setting a class name on the root grid element, and having different CSS rules for each mode, the grid must also be informed about this so that it's rendering logic can continue to work.
receive Objects()
remove Column Header Renderer Listener(listener)
Removes a listener previously been added via {#addColumnHeaderRendererListener}.
Parameters:
Name | Type | Description |
---|---|---|
listener |
module:ct-element |
The listener to remove. |
remove Grid View Listener(grid View Listener)
Removes a previously registered grid view listener.
Parameters:
Name | Type | Description |
---|---|---|
gridViewListener |
module:ct-grid |
The grid view listener to remove. |
remove Renderer Event Listener(renderer Event Listener)
Removes a RendererEventListener that was added with #addRendererEventListener
Parameters:
Name | Type | Description |
---|---|---|
rendererEventListener |
module:ct-element |
the listener to remove. |
set Container(oContainer)
Provides a reference to the container that will be hosting this component.
Parameters:
Name | Type | Description |
---|---|---|
oContainer |
module:ct-component |
The container hosting this component. |
- Implements:
- Deprecated:
- Yes
- See:
set Start Index(start Index)
Set the first row being displayed within the grid.
Parameters:
Name | Type | Description |
---|---|---|
startIndex |
integer | The row that will be displayed at the top of the grid. |