ResultEditor

(esrith/amos/form/ResultEditor)

ResultEditor is an enhanced version of ResultList. ResultEditor can delete results in a result list. The new list can then be used for further processing. It can also be further customized to do other features in conjunction with the default deletion function.

Description
new ResultEditor(params?srcNodeRef?)

Create a new ResultEditor 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

alwaysShowCheckbox Boolean

If true, checkboxes are always visible.

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

If true, the deletion checkboxes will hide after confirmation to delete selected results.

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

Field name in the result data that is used to determine whether the checkbox of a particular record is disabled from changing its state. Use this property in conjunction with disableCheckboxValue property.

disableCheckboxValue String | Number | Boolean | Object

Value of a coresponding field name in the result data that is used to determine whether the checkbox of a particular record is disabled from changing its state. Use this property in conjunction with disableCheckboxFieldName property.

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

If true, multiple deletions of result records are allowed.

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
preventInjection Boolean

If true, prevent HTML injection. If false, allow HTML injection. If null, the control will refer to the web configuration file whether to prevent or allow HTML injection.

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

Select all checkbox label.

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

Label of confirmation button (as part of delete confirmation).

textCancel String

Label of cancel button (as part of delete confirmation).

textDelete String

Delete button label.

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
__baseClassInherit(constructor) None

get className from superclass.

_abortRequest() None
bind(dataStore) Dojo/Deferred Bind data to the result list.
cancelMultiDelete() None

Cancel deletion of the checked records.

clearSelection(Array) None Clear record selections. If no parameter is given, all selections are unselected. Otherwise, only specified selections are unselected.
confirmMultiDelete(dataChecked) None

Comfirm deletion of the checked records.

disableReachXChecking() None

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

disableReachYChecking() None

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

enableReachXChecking() None

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

enableReachYChecking() None

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

forceChange(checkedvalue) None
getCheckBoxCheckedData() None

Get the checked record of result.

getUserIDIsSelected() Number[]

Get ID of the selected records.

hide(elem?) None

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

hideCustomIcon() None

Hide custom icon or option e.g. the default delete option.

isVisible(elem?) Boolean

Return true if the element is visible, otherwise false.

refresh(dataStore) None Refresh the result list. This will re-query the DataStore for the most up-to-date results.
reset(status) None

Enable or disble checkboxes according to status parameter.

reset() None

Resets the result editor.

setDataForceChecked(toolDef) None

Set a data to result editor with initial checked state to each record in the data.

shortcutXdata(data) None
show(elem?) None

Display a specified element.

showCustomIcon() None

Show custom icon or option e.g. the default delete option.

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.
confirm-multi-delete

Fires when confirmation on multiple deletion of checked records.

delete-cancel-click

Fires when click on cancel button (during delete confirmation phase).

delete-click

Fires when click on delete button.

delete-confirm-click

Fires when click on confirm button (during delete confirmation phase).

delete_click Fires when the mouse click delete button.
editor-check-all

Fires when click on select all checkbox.

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 ResultEditor(params?srcNodeRef?)

Inherited from _ResultItem but overwritten in esrith/amos/form/ResultEditor.js:25

Create a new ResultEditor 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>
alwaysShowCheckbox

If true, checkboxes are always visible.

Default value: true

<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

<Boolean>
autoHideCheckbox

If true, the deletion checkboxes will hide after confirmation to delete selected results.

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

Inherited from _ResultItem but overwritten in esrith/amos/form/ResultList.js:1467

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

Field name in the result data that is used to determine whether the checkbox of a particular record is disabled from changing its state. Use this property in conjunction with disableCheckboxValue property.

Default value: null

<String | Number | Boolean | Object>
disableCheckboxValue

Value of a coresponding field name in the result data that is used to determine whether the checkbox of a particular record is disabled from changing its state. Use this property in conjunction with disableCheckboxFieldName property.

Default value: null

<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

<Boolean>
enableMultiDelete

If true, multiple deletions of result records are allowed.

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

Inherited from _ResultItem but overwritten in esrith/amos/form/ResultList.js:395

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

Inherited from _ResultItem but overwritten in esrith/amos/form/ResultList.js:404

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

Inherited from _ResultItem but overwritten in esrith/amos/form/ResultList.js:426

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'
<Boolean>
preventInjection

If true, prevent HTML injection. If false, allow HTML injection. If null, the control will refer to the web configuration file whether to prevent or allow HTML injection.

Default value: false

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

Select all checkbox label.

Default value: "Hủy bỏ"

<String>
targetNode
Target node where the result list (excluding the record total) will be geanerated.
<String>
textCancel

Label of confirmation button (as part of delete confirmation).

Default value: "Hủy bỏ"

<String>
textCancel

Label of cancel button (as part of delete confirmation).

Default value: "Hủy bỏ"

<String>
textDelete

Delete button label.

Default value: "ลบข้อมูล"

<String>
titleField

Inherited from _ResultItem but overwritten in esrith/amos/form/ResultList.js:1452

Field name for the title of each record.

Default value: TITLE

<Boolean>
toggleSelect

Inherited from _ResultItem but overwritten in esrith/amos/form/ResultList.js:435

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
__baseClassInherit
(
  • constructor
)

get className from superclass.

Parameters
  • <Object> constructor Required
_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.
cancelMultiDelete
()

Cancel deletion of the checked records.

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.
confirmMultiDelete
(
  • dataChecked
)

Comfirm deletion of the checked records.

Parameters
  • <Object[]> dataChecked Required

    Checked records.

disableReachXChecking
()

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

disableReachYChecking
()

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

enableReachXChecking
()

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

enableReachYChecking
()

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

forceChange
(
  • checked
  • value
)
Parameters
getCheckBoxCheckedData
()

Inherited from ResultList but overwritten in esrith/amos/form/ResultEditor.js:733

Get the checked record of result.

<Number[]>
getUserIDIsSelected
()

Get ID of the selected records.

hide
(
  • elem?
)

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

Parameters
  • <Node> elem Optional

    Specified element to be hidden.

hideCustomIcon
()

Hide custom icon or option e.g. the default delete option.

<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
(
  • 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
(
  • status
)

Inherited from ResultList but overwritten in esrith/amos/form/ResultEditor.js:465

Enable or disble checkboxes according to status parameter.

Parameters
  • <Boolean> status Required

    State status of the checkboxes. If true, the checkboxes are enabled otherwise false.

reset
()

Resets the result editor.

setDataForceChecked
(
  • toolDef
)

Set a data to result editor with initial checked state to each record in the data.

Parameters
  • <Object[]> toolDef Required

    Checkbox ToolDef object.

shortcutXdata
(
  • data
)
Parameters
show
(
  • elem?
)

Display a specified element.

Parameters
  • <Node> elem Optional

    Specified element to be displayed.

showCustomIcon
()

Show custom icon or option e.g. the default delete option.

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

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.
confirm-multi-delete

Fires when confirmation on multiple deletion of checked records.

Event Payload:
  • <Object[]> dataChecked

    Checked records.

delete-cancel-click

Fires when click on cancel button (during delete confirmation phase).

delete-click

Fires when click on delete button.

delete-confirm-click

Fires when click on confirm button (during delete confirmation phase).

delete_click
Fires when the mouse click delete button.
Event Payload:
  • <Object> result
    Deleted data.
editor-check-all

Fires when click on select all checkbox.

Event Payload:
  • <Boolean> checked

    Checked status of the select all checkbox.

  • <Object[]> valueArr

    Checked records.

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.