ResultList

(esrith/amos/form/ResultList)

ResultList is a editable template for displaying a list of Results received from a dataStore. ResultList can split results into pages and have lazy-loading capability.

Description
new ResultList(params?srcNodeRef?)

Create a new ResultList widget.

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

alwaysShowPaging Boolean

If true, page navigation panel is shown and the result list 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.

currentPageLabel String

Label for current page in navigation panel.

customIcons ToolDef[]

Add custom icons and their functionalities using ToolDef objects.

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.

detailField String

Field name for the detail section of each record. The corresponding values to the field name can be a plain string or a HTML structure.

detailList Object

Detail of resultList on each record.

enabledGotoPage Boolean

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

enabledPinRunning Boolean

If true, the result list will sequentially lookup pin image file name with numbers inside directory specified in pinIcon property and with specified file type in pinExt property. i.e. First record in the page will use "pin1" then second record will be matched to "pin2 and continues until the last record. For this to be successful, there must be at least equal number of images with pageSize specified or all records in the data. If false, the result list will lookup pin image file name of "pin" only and it will use the image repeatedly until the last record.

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.

idProperty String

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

itemFirstLoad Number

The number of items to add to the result list during initial load in lazy loading mode.

itemOver Boolean

If true, each record will be highlighted as a mouse pointer moves over the record.

itemPerAppend Number

The number of items to append to the result list on subsequent loading in lazy loading mode.

itemPerQuery Number

The number of items to query for each query request in lazy loading mode.

items Dojo/store/Memory

Unused

itemSelect Boolean

If true, each record will be selectable.

itemSelectedData Object[]

Currently selected records of data.

lazyLoadMode Boolean

If true, the result list is in lazy loading mode.

multiSelect Boolean

If true, multiple records can be selected at the same time. This feature is active when itemSelect property is also true.

pageData Object[]

Container of all records in the current page.

pageFromLabel String

Label for total number of pages in navigation panel.

pagePerQuery Number

Number of result list 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.

pinExt String

Image file type.

pinIcon String

Relative path to pin image folder. You must to set name of image in the specified folder to format "pin{number}". Example: pin1

primaryKeyField String

Primary key field name. Required when ItemSelect and MultiSelect properties are set to 'true'. The result list's primary key field name must be specified before binding the data to the result list..

targetNode String

Target node where the result list (excluding the record total) will be geanerated.

titleField String

Field name for the title of each record.

toggleSelect Boolean

If true, a record toggles between selected and normal states when they are clicked repeatedly. This feature is active when itemSelect property is also true.

total Number

Total number of records of data.

totalTextFormat String

Text format to show total number of records.

visibleDeleteIcon Boolean

If true, delete icon is shown on the rigth of record.

visiblePinIcon Boolean

If true, pin icons is shown on each record.

width Number | String

Width of a result list.

xPercentage Number

The percentage of scroll remaining in x-axis (horizontal).

xPixels Number

The pixel of scroll remaining in x-axis (horizontal).

yPercentage Number

The percentage of scroll remaining in y-axis (vertical).

yPixels Number

The pixel of scroll remaining in y-axis (vertical).

Return type Description
_abortRequest() None
bind(dataStore) Dojo/Deferred

Bind data to the result list.

refresh(dataStore) None

Refresh the result list. This will re-query the DataStore for the most up-to-date results.

reset() None

Reset all state and value to default.

getCheckBoxCheckedData(toolDef) Object[]

Return records with checkbox checked.

clearSelection(Array) None

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

__baseClassInherit(constructor) None

get className from superclass.

unbind() None

Remove binded data from control

() Dojo/store/Memory

Return a Memory object containing all records within a result list page. If the result list is in lazy loading mode, only loaded data prior usage of this methof is returned. Further data will be available as the result list loads more data prior subsequent usage of this method.

isVisible(elem?) Boolean

Return true if the element is visible, otherwise false.

toggle(elem?) None

Toggle visibility of a specified element.

show(elem?) None

Display a specified element.

hide(elem?) None

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

disableReachXChecking() None

Disable the lazy loading checkings. Data will not be loaded further than the specified position eventhough xPercentage or xPixel properties are reached.

enableReachXChecking() None

Enable lazy loading checkings in x-axis (horizontal).

disableReachYChecking() None

Disable the lazy loading checkings. Data will not be loaded further than the specified position eventhough yPercentage or yPixel properties are reached.

enableReachYChecking() None

Enable lazy loading checkings in y-axis (vertical).

Description
bind-completed

Fires when bind data completed.

bind-error

Fires when bind data error.

delete_click

Fires when the mouse click delete button.

image-click

Fires when the user clicks on an image.

image-mouseout

Fires when the mouse pointer is moved out of an image.

image-mouseover

Fires when the mouse pointer is moved over an image.

item-click

Fires when the user clicks on an item.

item-mouseout

Fires when the mouse pointer is moved out of an item.

item-mouseover

Fires when the mouse pointer is moved onto an item.

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.

reached-x

Fired when xPercentage or xPixel properties are reached.

reached-y

Fired when yPercentage or yPixel properties are reached.

tool-click

Fires when tool clicked (icon custom).

Constructors Detail
new ResultList(params?srcNodeRef?)

Create a new ResultList widget.

Parameters:
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>
alwaysShowPaging

If true, page navigation panel is shown and the result list 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>
currentPageLabel

Label for current page in navigation panel.

Default value: หน้า

<ToolDef[]>
customIcons

Add custom icons and their functionalities using ToolDef objects.

<String>
dataNotFoundText

Message that displays when there is no data found.

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

<DataStore>
dataStore

Inherited from _BindMixin but overwritten in esrith/amos/form/ResultList.js:270

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

<String>
detailField

Field name for the detail section of each record. The corresponding values to the field name can be a plain string or a HTML structure.

Default value: DETAIL

<Object>
detailList

Detail of resultList on each record.

<Boolean>
enabledGotoPage

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

Default value: false

<Boolean>
enabledPinRunning

If true, the result list will sequentially lookup pin image file name with numbers inside directory specified in pinIcon property and with specified file type in pinExt property. i.e. First record in the page will use "pin1" then second record will be matched to "pin2 and continues until the last record. For this to be successful, there must be at least equal number of images with pageSize specified or all records in the data. If false, the result list will lookup pin image file name of "pin" only and it will use the image repeatedly until the last record.

Default value: true

<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 });
<String>
idProperty

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

Default value: "id"

<Number>
itemFirstLoad

The number of items to add to the result list during initial load in lazy loading mode.

Default value: 10

<Boolean>
itemOver

If true, each record will be highlighted as a mouse pointer moves over the record.

Default value: true

<Number>
itemPerAppend

The number of items to append to the result list on subsequent loading in lazy loading mode.

Default value: 3

<Number>
itemPerQuery

The number of items to query for each query request in lazy loading mode.

Default value: 3

<Dojo/store/Memory>
items

Inherited from _BindMixin but overwritten in esrith/amos/form/ResultList.js:123

Unused

<Boolean>
itemSelect

If true, each record will be selectable.

Default value: false

<Object[]>
itemSelectedData

Currently selected records of data.

Default value: null

<Boolean>
lazyLoadMode

If true, the result list is in lazy loading mode.

Default value: false

<Boolean>
multiSelect

If true, multiple records can be selected at the same time. This feature is active when itemSelect property is also true.

Default value: false

<Object[]>
pageData

Container of all records in the current page.

<String>
pageFromLabel

Label for total number of pages in navigation panel.

Default value: จาก

<Number>
pagePerQuery

Number of result list 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>
pinExt

Image file type.

Default value: .png

<String>
pinIcon

Relative path to pin image folder. You must to set name of image in the specified folder to format "pin{number}". Example: pin1

Sample:
      pinIcon: 'images/png/pin'
<String>
primaryKeyField

Primary key field name. Required when ItemSelect and MultiSelect properties are set to 'true'. The result list's primary key field name must be specified before binding the data to the result list..

<String>
targetNode

Target node where the result list (excluding the record total) will be geanerated.

<String>
titleField

Field name for the title of each record.

Default value: TITLE

<Boolean>
toggleSelect

If true, a record toggles between selected and normal states when they are clicked repeatedly. This feature is active when itemSelect property is also true.

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} รายการ

<Boolean>
visibleDeleteIcon

If true, delete icon is shown on the rigth of record.

Default value: false

<Boolean>
visiblePinIcon

If true, pin icons is shown on each record.

Default value: true

<Number | String>
width

Width of a result list.

Default value: 100%

<Number>
xPercentage

The percentage of scroll remaining in x-axis (horizontal).

Default value: null

<Number>
xPixels

The pixel of scroll remaining in x-axis (horizontal).

Default value: null

<Number>
yPercentage

The percentage of scroll remaining in y-axis (vertical).

Default value: null

<Number>
yPixels

The pixel of scroll remaining in y-axis (vertical).

Default value: null

Methods Detail
_abortRequest
()
<Dojo/Deferred>
bind
(
  • dataStore
)

Inherited from _BindMixin but overwritten in esrith/amos/form/ResultList.js:509

Bind data to the result list.

Parameters
  • <DataStore> dataStore Required

    DataStore of data for binding to the result list.

refresh
(
  • dataStore
)

Refresh the result list. This will re-query the DataStore for the most up-to-date results.

Parameters
  • <DataStore> dataStore Required

    DataStore of data for refreshing to the result list.

reset
()

Reset all state and value to default.

<Object[]>
getCheckBoxCheckedData
(
  • toolDef
)

Return records with checkbox checked.

Parameters
  • <Object> toolDef Required

    Checkbox ToolDef object.

clearSelection
(
  • Array
)

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

Parameters
  • <Number[]> Array Required

    of primary keys of specific records.

__baseClassInherit
(
  • constructor
)

get className from superclass.

Parameters
  • <Object> constructor Required
unbind
()

Remove binded data from control

<Dojo/store/Memory>
()

Return a Memory object containing all records within a result list page. If the result list is in lazy loading mode, only loaded data prior usage of this methof is returned. Further data will be available as the result list loads more data prior subsequent usage of this method.

<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.

toggle
(
  • elem?
)

Toggle visibility of a specified element.

Parameters
  • <Node> elem Optional

    Specified element to toggle visibility.

show
(
  • elem?
)

Display a specified element.

Parameters
  • <Node> elem Optional

    Specified element to be displayed.

hide
(
  • elem?
)

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

Parameters
  • <Node> elem Optional

    Specified element to be hidden.

disableReachXChecking
()

Disable the lazy loading checkings. Data will not be loaded further than the specified position eventhough xPercentage or xPixel properties are reached.

enableReachXChecking
()

Enable lazy loading checkings in x-axis (horizontal).

disableReachYChecking
()

Disable the lazy loading checkings. Data will not be loaded further than the specified position eventhough yPercentage or yPixel properties are reached.

enableReachYChecking
()

Enable lazy loading checkings in y-axis (vertical).

Events Detail
bind-completed

Fires when bind data completed.

Event Payload:
  • <Object> data

    Data that bind to the control.

bind-error

Fires when bind data error.

Event Payload:
  • <Object> err

    Data binding error detail.

delete_click

Fires when the mouse click delete button.

Event Payload:
  • <Object> result

    Deleted data.

image-click

Fires when the user clicks on an image.

Event Payload:
  • <Object> objData

    Page record number and data of the record.

  • <Object> evt

    javascript event object.

image-mouseout

Fires when the mouse pointer is moved out of an image.

Event Payload:
  • <Object> objData

    Page record number and data of the record.

  • <Object> evt

    javascript event object.

image-mouseover

Fires when the mouse pointer is moved over an image.

Event Payload:
  • <Object> objData

    Page record number and data of the record.

  • <Object> evt

    javascript event object.

item-click

Fires when the user clicks on an item.

Event Payload:
  • <Object> objData

    Page record number and data of the record.

  • <Object> evt

    javascript event object.

item-mouseout

Fires when the mouse pointer is moved out of an item.

Event Payload:
  • <Object> objData

    Page record number and data of the record.

  • <Object> evt

    javascript event object.

item-mouseover

Fires when the mouse pointer is moved onto an item.

Event Payload:
  • <Object> objData

    Page record number and data of the record.

  • <Object> evt

    javascript event object.

page_Changed

Fires when page changed.

Event Payload:
  • <Number> page

    Current page number

query-data-completed

Fires when query data completed.

Event Payload:
  • <Object> response

    Response when query data complete.

query-data-error

Inherited from _BindMixin but overwritten in esrith/amos/form/ResultList.js:648

Fires when query data error.

Event Payload:
  • <Object> err

    Querying error detail.

query-data-start

Fires when start query data.

Event Payload:
reached-x

Fired when xPercentage or xPixel properties are reached.

reached-y

Fired when yPercentage or yPixel properties are reached.

tool-click

Fires when tool clicked (icon custom).

Event Payload:
  • <Object> data

    Data of the clicked record.

  • <Object> toolDef

    Clicked tool in the record.