Nitido InfiniteScroller UI Control

InfiniteScroller Control  1.0.0

Nitido InfiniteScroller UI Control > infinitescroller > NIM.ui.InfiniteScroller
Search:
 
Filters

Class NIM.ui.InfiniteScroller

InfiniteScroller

Constructor

NIM.ui.InfiniteScroller ( configs )
Parameters:
configs <Object> Object literal of configuration values.

Properties

InfiniteScroller.COLUMN_CHECKBOX - static final String

Default formatter for Columns containing checkbox elements
Default Value: "checkbox"

InfiniteScroller.COLUMN_CHECKBOX_ID - static final String

ID assigned to the "Select All" checkbox for a Column defined as "selectAll"
Default Value: "nv-dt-cb"

InfiniteScroller.ID_PREFIX - static final String

ID prefix for InfiniteScroller widgets
Default Value: "nv-infs-"

InfiniteScroller.SORT_DESC - static final String

Descending sort order.
Default Value: "DESC"

nfiniteScroller.SORT_ASC - static final String

Ascending sort order
Default Value: "ASC"

Methods

checkboxSelectAll

void checkboxSelectAll ( )
Marks all rows in the table as selected.
Returns: void

checkboxUnselectAll

void checkboxUnselectAll ( )
Marks all rows in the table as unselected.
Returns: void

checkRow

void checkRow ( record )
Sets given row to the selected state
Parameters:
record <HTMLElement | String | YAHOO.widget.Record | Number> HTML element reference or ID string, Record instance, or RecordSet position index.
Returns: void

getRecord

void getRecord ( )
Returns: void

getSelectedRows

String[] getSelectedRows ( )
Returns selected rows as an array of Primary Keys (specified by the DataSource).
Returns: String[]
Array of selected rows by Primary Key.

getTotalRows

Number getTotalRows ( )
Returns the total number of rows in the table
Returns: Number
Total number of rows in the table

setLoadMaskMessage

void setLoadMaskMessage ( show )
Set's the text of the table's modal/loading overlay
Parameters:
show <String|null> The message to display; if NULL is passed, the message reverts to the default "Loading..." specified when the table was instantiated
Returns: void

setMessage

void setMessage ( )
Returns: void

setTotalRows

void setTotalRows ( n )
Sets the total number of rows in the table to the given number
Parameters:
n <Number> Total number of rows
Returns: void

showLoadMask

void showLoadMask ( show )
Displays the table's modal/loading overlay
Parameters:
show <Boolean> True to display the load mask, false to hide it
Returns: void

uncheckAllRows

void uncheckAllRows ( )
Sets all rows to the unselected state
Returns: void

uncheckRow

void uncheckRow ( record )
Sets given row to the unselected state
Parameters:
record <HTMLElement | String | YAHOO.widget.Record | Number> HTML element reference or ID string, Record instance, or RecordSet position index.
Returns: void

updateData

void updateData ( rows )
Updates the table's RecordSet with the given rows, as well as updating the UI with the new rows
Parameters:
rows <Array> Array of rows to render
Returns: void

Events

beforeColumnsChange

beforeColumnsChange ( event )
Fires before the value for the configuration attribute 'columns' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeContainerChange

beforeContainerChange ( event )
Fires before the value for the configuration attribute 'container' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeDataSourceChange

beforeDataSourceChange ( event )
Fires before the value for the configuration attribute 'dataSource' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeDragdropChange

beforeDragdropChange ( event )
Fires before the value for the configuration attribute 'dragdrop' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeFormatRowChange

beforeFormatRowChange ( event )
Fires before the value for the configuration attribute 'formatRow' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeMSG_EMPTYChange

beforeMSG_EMPTYChange ( event )
Fires before the value for the configuration attribute 'MSG_EMPTY' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeMSG_LOADINGChange

beforeMSG_LOADINGChange ( event )
Fires before the value for the configuration attribute 'MSG_LOADING' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforePrefetchChange

beforePrefetchChange ( event )
Fires before the value for the configuration attribute 'prefetch' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeSortedByChange

beforeSortedByChange ( event )
Fires before the value for the configuration attribute 'sortedBy' changes. Return false to cancel the attribute change.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

checkboxClickEvent

checkboxClickEvent ( oArgs.checked , oArgs.element , oArgs.recordId )
Fired when a CHECKBOX element is clicked.
Parameters:
oArgs.checked <Boolean> True if the item was checked
oArgs.element <HTMLElement> The DOM element reference of the checkbox element
oArgs.recordId <Record> : The record ID corresponding to the checked row

columnsChange

columnsChange ( event )
Fires when the value for the configuration attribute 'columns' changes.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

columnSortEvent

columnSortEvent ( oArgs.column , oArgs.order , oArgs.start , oArgs.end )
Fired when a column is sorted
Parameters:
oArgs.column <String> The Column's key
oArgs.order <String> The sort order (NIM.ui.InfiniteScroller.SORT_ASC or NIM.ui.InfiniteScroller.SORT_DESC)
oArgs.start <Number> The start offset/index of the viewable segment of rows to load
oArgs.end <Number> The end offset/index of the viewable segment of rows to load

containerChange

containerChange ( event )
Fires when the value for the configuration attribute 'container' changes.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

dataChangeEvent

dataChangeEvent ( oArgs.start , oArgs.end )
Fired when there has been a change to the data being displayed in the control (ie: user has scrolled, and new records need to be loaded)
Parameters:
oArgs.start <Number> The start offset/index of the viewable segment of rows to load
oArgs.end <Number> The end offset/index of the viewable segment of rows to load

dataSourceChange

dataSourceChange ( event )
Fires when the value for the configuration attribute 'dataSource' changes.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

dragdropChange

dragdropChange ( event )
Fires when the value for the configuration attribute 'dragdrop' changes.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

formatRowChange

formatRowChange ( event )
Fires when the value for the configuration attribute 'formatRow' changes.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

MSG_EMPTYChange

MSG_EMPTYChange ( event )
Fires when the value for the configuration attribute 'MSG_EMPTY' changes.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

MSG_LOADINGChange

MSG_LOADINGChange ( event )
Fires when the value for the configuration attribute 'MSG_LOADING' changes.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

prefetchChange

prefetchChange ( event )
Fires when the value for the configuration attribute 'prefetch' changes.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

rowClickEvent

rowClickEvent ( oArgs.recordId )
Fired when a row has a click.
Parameters:
oArgs.recordId <Number> The record ID corresponding to the clicked row

rowDragEndEvent

rowDragEndEvent ( oArgs.recordId )
Fired when a row drag has ended.
Parameters:
oArgs.recordId <Number> The record ID corresponding to the clicked row

rowDragStartEvent

rowDragStartEvent ( oArgs.recordId )
Fired when a row drag has started.
Parameters:
oArgs.recordId <Number> The record ID corresponding to the clicked row

rowMouseoutEvent

rowMouseoutEvent ( oArgs.recordId )
Fired when a row has a mouseout
Parameters:
oArgs.recordId <Number> The record ID corresponding to the clicked row

rowMouseoverEvent

rowMouseoverEvent ( oArgs.recordId )
Fired when a row has a mouseover
Parameters:
oArgs.recordId <Number> The record ID corresponding to the clicked row

selectAllClickEvent

selectAllClickEvent ( oArgs.checked )
Fired when a column defined as a NIM.ui.InfiniteScroller.COLUMN_CHECKBOX with selectAll behaviour is clicked
Parameters:
oArgs.checked <Boolean> True if select all is checked

sortedByChange

sortedByChange ( event )
Fires when the value for the configuration attribute 'sortedBy' changes.
Parameters:
event <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

Configuration Attributes

columns - Object

A list of column objects to be rendered in the InfiniteScroller (see Column Definitions in the InfiniteScroller How To document)

container - String | HTMLElement

The parent DOM container in which to render the InfiniteScroller

dataSource - NIM.util.DataSource

A NIM.util.DataSource instance (see Data Source Definition in the InfiniteScroller How To document)

dragdrop - NIM.util.BaseDDProxy | null

A drag and drop proxy object to support drag and drop in the InfiniteScroller

formatRow - HTMLFunction | null

A function to call to perform any custom formatting for the table row.

MSG_EMPTY - String | null

The string to display when there are no records in the InfiniteScroller
Default Value: "No records found."

MSG_LOADING - String | null

The string to display when messages are loading in the InfiniteScroller
Default Value: "Loading..."

prefetch - Object | null

An object to indicate the table should be preloaded with data. The object contains the following properties:
prefetch.handler
{HTMLFunction} The callback function to call in order to indicate which records should be loaded. The function should accept the following parameters:
handler
The callback function to call in order to indicate which records should be loaded.
scope
The object to set as the execution scope of the handler function

sortedBy - Object | null

Object literal provides metadata for initial sort values if data will arrive pre-sorted:
sortedBy.key
{String} Key of sorted Column
sortedBy.dir
{String} Initial sort direction, either NIM.ui.InfiniteScroller.SORT_ASC or NIM.ui.InfiniteScroller.SORT_DESC


Copyright © 2010 Nitido Inc. All rights reserved.