_TableInteractiveBase

(esrith/amos/core/_TableInteractiveBase)

Private extended class of _TableBase. This class adds highlighting on mouseclick or mouseover to tablerows or tablecells.

Type Description
_itemData Dojo/store/Memory

ItemData is a data in items.

_styleAttr Object

when you want to set style for other node. you can do this by example... _styleAttr:{ style-property:effected-node } this property was effected where this class was inherited and your widget was called by... var widget = new YourWidget({ style:{ style-property:style-value } }); now effected-node in you widget will have style-property = style-value

alternateRowColors Boolean

If true, the table will have alternating row colors.

alwaysShowfreezing Boolean

If true, show loading and it will stop after query is completed.

alwaysShowPaging Boolean

If true, page navigation panel is shown and table is shown with all applicable paging settings. If false, there is no page navigation panel and all data records are displayed in one page.

beginParamName String

Specifies first parameter name that used to begin query data when set pagePerQuery > 0 or alwaysShowPaging=true. In the process the widget will automatically calculate first record. 'Service' and 'stored procedure' must support this parameter.

calculateType String

Type of calculate. If 'hasMathRow' true must include calculateType.

cellOver Boolean

If true, a table cell is highlighted when the mouse pointer is over it.

cellSelect Boolean

If true, a user can click a table cell then the cell is highlighted. Important: 'primaryKeyField' must be defined for this to work properly.

cellSelected Object[]

An array of data in the selected table cells.

columns ColumnDef[]

Column that displays in a table. (Array of columnDef.)

currentPageLabel String

Label for current page in navigation panel.

dataNotFoundIcon String

Icon that displays when there is no data found.

dataNotFoundText String

Message that displays when there is no data found.

dataStore DataStore

A data store is a repository of a set of data objects.

enabledGotoPage Boolean

If true, a user can specifies a page to change by inputting a page number.

enabledTotal Boolean

If true, display total number of records in a table.

endParamName String

Specifies last parameter name that used to query data when set pagePerQuery > 0 or alwaysShowPaging=true. In the process the widget will automatically calculate last record. 'Service' and 'stored procedure' must support this parameter.

filter Object | Function

A data filter.

hasMathRow Boolean

Insert a row to show Sum (or average), If set to true must include "calculateType"

idProperty String

An unique id for an element. (The specified value must be unique within the document.)

items Dojo/store/Memory

Items is a memory to collect a set of data.

loadDelay Number

Time period in seconds to wait before show 'alwaysShowfreezing' (loading). In case the query finished before this time period ends, 'alwaysShowfreezing' (loading) is not shown at all.

loadingIcon String

loading icon.

multiSelect Boolean

If true, a user can select multiple rows or cells.

multiSort Boolean

If true, this allows sorting in multiple column. This is server-side sorting. The stored procedure must support this else this will not function.

noDataStyle String

Style that is used when there is no data (use constant).

pageFromLabel String

Label for total number of pages in navigation panel.

pagePerQuery Number

Number of table pages per one query request.

pageSize Number

Number of records to be displayed on each page.

pagingBand Object

Number of visible page numbers for each screen size. This object contains 3 fields:

  1. phone: number of paging for size phone.
  2. tablet: number of paging for size tablet.
  3. desktop: number of paging for size desktop.
pagingSize Number

Number of visible page numbers in page navigation.

primaryKeyField String

Primary key field name. Required when the table has these column types; TYPE_CHECKBOX or TYPE_RADIOBUTTON. The table's primary key field name must be specified before setting columns to the table.

rowOver Boolean

If true, a table row is highlighted when the mouse pointer is over it.

rowSelect Boolean

If true, a user can click a table row then the row is highlighted. Important: 'primaryKeyField' must be defined for this to work properly.

rowSelectedData Object[]

An array of data in the selected table rows.

sortOptions Object[]

Collect column that sort data. Object contains 2 values 1.id: field name that you want to sort 2.sortType: type of sorting

toggleSelect Boolean

If true, a table cell or row toggle between selected and normal states when they are clicked repeatedly.

total Number

Total number of records of data.

totalTextFormat String

Text format to show total number of records.

width Number | String

Width of table.

Return type Description
__baseClassInherit(constructor) None

get className from superclass.

_abortRequest() None
bind(dataStore) Dojo/Deferred

Bind data to the control.

checkAllCurrentPage(columnDefcheckced) Object[]

Check all columns in current page. You can specifies checked is true or false.

clearCellSelection(idAndFieldNames) None

Clear cell selection. If no parameter is given, all selections are unselected. Otherwise, only specified selections are unselected.

clearRowSelection(ids) None

Clear row selections. If no parameter is given, all selections are unselected. Otherwise, only specified selections are unselected.

getCheckBoxCheckedData(columnDef) Object[]

Return columns that checkbox is checked.

getCheckBoxUnCheckedData(columnDef) Object[]

Return columns that checkbox is unchecked.

getRadioCheckedData(columnDef) Object[]

Return columns that radio button is checked.

getRadioUnCheckedData(columnDef) Object[]

Return columns that radio button is unchecked.

hide(elem?) None

Hide a specified element. The hidden element will not be displayed at all.

isVisible(elem?) Boolean

Return true if the element is visible, otherwise false.

refresh() None

Refresh a table.

reset() None

Reset all state and value to default.

show(elem?) None

Display a specified element.

toggle(elem?) None

Toggle visibility of a specified element.

unbind() None

Remove binded data from control

Description
bind-completed

Fires when bind data completed.

bind-error

Fires when bind data error.

cell_Click

Fires when click on a cell.

cell_MouseOut

Fires when mouse pointer is moved out from cell.

cell_MouseOver

Fires when mouse pointer moved over a cell.

header_Click

Fires when click header.

page_Changed

Fires when page changed.

query-data-completed

Fires when query data completed.

query-data-error

Fires when query data error.

query-data-start

Fires when start query data.

row_Click

Fires when click on a row.

row_MouseOut

Fires when mouse pointer is moved out from row.

row_MouseOver

Fires when mouse pointer moved over a row.

sort_Click

Fires when click on a sort icon. The object from this event is used as follows:

  1. Use the data from sortOption as parameters for requesting the stored procedure to return a sorted data.
  2. Create a new dataStore instance for storing returned sorted data.
  3. Rebind and refresh data in the table.
Properties Detail
<Dojo/store/Memory>
_itemData

ItemData is a data in items.

<Object>
_styleAttr

when you want to set style for other node. you can do this by example... _styleAttr:{ style-property:effected-node } this property was effected where this class was inherited and your widget was called by... var widget = new YourWidget({ style:{ style-property:style-value } }); now effected-node in you widget will have style-property = style-value

Default value: {}

<Boolean>
alternateRowColors

If true, the table will have alternating row colors.

Default value: false

<Boolean>
alwaysShowfreezing

If true, show loading and it will stop after query is completed.

Default value: true

<Boolean>
alwaysShowPaging

If true, page navigation panel is shown and table is shown with all applicable paging settings. If false, there is no page navigation panel and all data records are displayed in one page.

Default value: true

<String>
beginParamName

Specifies first parameter name that used to begin query data when set pagePerQuery > 0 or alwaysShowPaging=true. In the process the widget will automatically calculate first record. 'Service' and 'stored procedure' must support this parameter.

Default value: BEGIN

<String>
calculateType

Type of calculate. If 'hasMathRow' true must include calculateType.

Default value: sum

<Boolean>
cellOver

If true, a table cell is highlighted when the mouse pointer is over it.

Default value: false

<Boolean>
cellSelect

If true, a user can click a table cell then the cell is highlighted. Important: 'primaryKeyField' must be defined for this to work properly.

Default value: false

<Object[]>
cellSelected

An array of data in the selected table cells.

<ColumnDef[]>
columns

Column that displays in a table. (Array of columnDef.)

<String>
currentPageLabel

Label for current page in navigation panel.

Default value: หน้า

<String>
dataNotFoundIcon

Icon that displays when there is no data found.

<String>
dataNotFoundText

Message that displays when there is no data found.

Default value: ไม่พบข้อมูล

<DataStore>
dataStore

Inherited from _BindMixin but overwritten in esrith/amos/core/_TableBase.js:295

A data store is a repository of a set of data objects.

<Boolean>
enabledGotoPage

Inherited from _TableBase but overwritten in esrith/amos/core/_TableBase.js:259

If true, a user can specifies a page to change by inputting a page number.

Default value: false

<Boolean>
enabledTotal

If true, display total number of records in a table.

Default value: true

<String>
endParamName

Specifies last parameter name that used to query data when set pagePerQuery > 0 or alwaysShowPaging=true. In the process the widget will automatically calculate last record. 'Service' and 'stored procedure' must support this parameter.

Default value: END

<Object | Function>
filter

A data filter.

Sample:
     // 1. for type of Function
             this.set("filter", lang.hitch(this, function (item) {
                 return item["CHECK"] == true;
             }));
        
             // 2. for type of Object
             this.set("filter", { CHECK: true });
<Boolean>
hasMathRow

Insert a row to show Sum (or average), If set to true must include "calculateType"

Default value: false

<String>
idProperty

An unique id for an element. (The specified value must be unique within the document.)

Default value: "id"

<Dojo/store/Memory>
items

Items is a memory to collect a set of data.

<Number>
loadDelay

Time period in seconds to wait before show 'alwaysShowfreezing' (loading). In case the query finished before this time period ends, 'alwaysShowfreezing' (loading) is not shown at all.

Default value: 2

<String>
loadingIcon

loading icon.

<Boolean>
multiSelect

If true, a user can select multiple rows or cells.

Default value: false

<Boolean>
multiSort

If true, this allows sorting in multiple column. This is server-side sorting. The stored procedure must support this else this will not function.

Default value: false

<String>
noDataStyle

Style that is used when there is no data (use constant).

Default value: STYLE_NO_DATA_SHOW_HEADER

<String>
pageFromLabel

Label for total number of pages in navigation panel.

Default value: จาก

<Number>
pagePerQuery

Number of table pages per one query request.

Default value: 5

<Number>
pageSize

Number of records to be displayed on each page.

Default value: 10

<Object>
pagingBand

Number of visible page numbers for each screen size. This object contains 3 fields:

  1. phone: number of paging for size phone.
  2. tablet: number of paging for size tablet.
  3. desktop: number of paging for size desktop.
Sample:
      pagingBand: { 
                  phone: 3,
                  tablet: 7,
                  desktop: 10}
<Number>
pagingSize

Number of visible page numbers in page navigation.

Default value: 15

<String>
primaryKeyField

Primary key field name. Required when the table has these column types; TYPE_CHECKBOX or TYPE_RADIOBUTTON. The table's primary key field name must be specified before setting columns to the table.

<Boolean>
rowOver

If true, a table row is highlighted when the mouse pointer is over it.

Default value: true

<Boolean>
rowSelect

If true, a user can click a table row then the row is highlighted. Important: 'primaryKeyField' must be defined for this to work properly.

Default value: false

<Object[]>
rowSelectedData

An array of data in the selected table rows.

<Object[]>
sortOptions

Collect column that sort data. Object contains 2 values 1.id: field name that you want to sort 2.sortType: type of sorting

<Boolean>
toggleSelect

If true, a table cell or row toggle between selected and normal states when they are clicked repeatedly.

Default value: true

<Number>
total

Total number of records of data.

Default value: 0

<String>
totalTextFormat

Text format to show total number of records.

Default value: จำนวนผลลัพธ์ {total} รายการ

<Number | String>
width

Width of table.

Default value: 100%

Methods Detail
__baseClassInherit
(
  • constructor
)

get className from superclass.

Parameters
  • <Object> constructor Required
_abortRequest
()
<Dojo/Deferred>
bind
(
  • dataStore
)

Inherited from _BindMixin but overwritten in esrith/amos/core/_TableBase.js:470

Bind data to the control.

Parameters
  • <DataStore> dataStore Required

    DataStore of data for binding to the control.

<Object[]>
checkAllCurrentPage
(
  • columnDef
  • checkced
)

Check all columns in current page. You can specifies checked is true or false.

Parameters
  • <Object> columnDef Required

    Column detail

  • <Boolean> checkced Required

    Specifies checked is true or false.

clearCellSelection
(
  • idAndFieldNames
)

Clear cell selection. If no parameter is given, all selections are unselected. Otherwise, only specified selections are unselected.

Parameters
  • <Object[]> idAndFieldNames Required

    Array of row ids and field names of cells

clearRowSelection
(
  • ids
)

Clear row selections. If no parameter is given, all selections are unselected. Otherwise, only specified selections are unselected.

Parameters
  • <Object[]> ids Required

    Array of row ids

<Object[]>
getCheckBoxCheckedData
(
  • columnDef
)

Return columns that checkbox is checked.

Parameters
  • <Object> columnDef Required

    Column detail.

<Object[]>
getCheckBoxUnCheckedData
(
  • columnDef
)

Return columns that checkbox is unchecked.

Parameters
  • <Object> columnDef Required

    Column detail.

<Object[]>
getRadioCheckedData
(
  • columnDef
)

Return columns that radio button is checked.

Parameters
  • <Object> columnDef Required

    Column detail.

<Object[]>
getRadioUnCheckedData
(
  • columnDef
)

Return columns that radio button is unchecked.

Parameters
  • <Object> columnDef Required

    Column detail.

hide
(
  • elem?
)

Hide a specified element. The hidden element will not be displayed at all.

Parameters
  • <Node> elem Optional

    Specified element to be hidden.

<Boolean>
isVisible
(
  • elem?
)

Return true if the element is visible, otherwise false.

Parameters
  • <Node> elem Optional

    Specified element to be checked. If not specified, domNode of the widget is used instead.

refresh
()

Refresh a table.

reset
()

Reset all state and value to default.

show
(
  • elem?
)

Display a specified element.

Parameters
  • <Node> elem Optional

    Specified element to be displayed.

toggle
(
  • elem?
)

Toggle visibility of a specified element.

Parameters
  • <Node> elem Optional

    Specified element to toggle visibility.

unbind
()

Remove binded data from control

Events Detail
bind-completed

Inherited from _BindMixin but overwritten in esrith/amos/core/_TableBase.js:520

Fires when bind data completed.

Event Payload:
  • <Object> arg

    Result from bind data complete.

bind-error

Fires when bind data error.

Event Payload:
  • <Object> err

    Rrror detail from bind data.

cell_Click

Fires when click on a cell.

Event Payload:
  • <Object> data

    Row data.

  • <Object> columnDef

    Column detail

  • <String> td

    HTML column structure.

  • <String> tr

    HTML row structure.

  • <Object> evt

    javascript event object

cell_MouseOut

Fires when mouse pointer is moved out from cell.

Event Payload:
cell_MouseOver

Fires when mouse pointer moved over a cell.

Event Payload:
header_Click

Fires when click header.

Event Payload:
  • <Object> columnDef

    Column detail.

page_Changed

Fires when page changed.

Event Payload:
  • <Number> page

    Current page number.

query-data-completed

Inherited from _BindMixin but overwritten in esrith/amos/core/_TableBase.js:507

Fires when query data completed.

Event Payload:
  • <Object> arg

    Result from query data complete.

query-data-error

Inherited from _BindMixin but overwritten in esrith/amos/core/_TableBase.js:538

Fires when query data error.

Event Payload:
  • <Object> err

    Rrror detail from query data.

query-data-start

Fires when start query data.

Event Payload:
row_Click

Fires when click on a row.

Event Payload:
row_MouseOut

Fires when mouse pointer is moved out from row.

Event Payload:
row_MouseOver

Fires when mouse pointer moved over a row.

Event Payload:
sort_Click

Fires when click on a sort icon. The object from this event is used as follows:

  1. Use the data from sortOption as parameters for requesting the stored procedure to return a sorted data.
  2. Create a new dataStore instance for storing returned sorted data.
  3. Rebind and refresh data in the table.
Event Payload:
  • <Object[]> sortOption

    An array of object. The object contains 2 fields:
    1. columnDef: column of field that clicked sort icon.
    2. sortType: type of sorting.