API Documentation
Classes
Functions
createLookup(dataSource) ⇒ Lookup
Creates a lookup object which can be used to show a pop-up form
createQueryLookup(qbSelect, [dsName], [overrideData]) ⇒ Lookup
Creates a read only, in-memory datasource from the given query and creates a Lookup for that
createValueListLookup(valuelistName, [titleText]) ⇒ Lookup
Creates a lookup object from a valuelist which can be used to show a pop-up form or a modal window
NOTE: Valuelist cannot be based on a database relation or a global method. Custom Valuelists can show up to 500 items in lookup.
Lookup
.createPopUp(callback, [initialValue]) ⇒
plugins.window.FormPopup
.getDataSource() ⇒
String
.getFieldCount() ⇒
Number
.getFoundSet() ⇒
JSFoundSet
.getLookupDataProvider() ⇒
String
.getLookupForm() ⇒
[ 'RuntimeForm' ].<AbstractLookup>
.getParams() ⇒
Array
.getSelectedRecords() ⇒
[ 'Array' ].<JSRecord>
.getSelectedValues() ⇒
[ 'Array' ].<JSRecord>
.showModalWindow([callback], [x], [y], [width], [height], [initialValue]) ⇒
Array.<JSRecord>
|Array.<(String|Date|Number)>
.showWindow(win, [callback], [initialValue]) ⇒
Array.<JSRecord>
|Array.<(String|Date|Number)>
lookup.addField(dataProvider) ⇒ LookupField
LookupField
Adds a field to the lookup object
Param | Type |
---|---|
dataProvider |
|
Example
lookup.addParam(param)
Add a params to be added into the onSelect callback arguments
Param | Type |
---|---|
param |
|
Example
lookup.addSelectedRecord(record)
Adds the given record to the list of selected records
Param | Type |
---|---|
record |
|
lookup.clearParams()
Clear the params
lookup.clearSelectedRecords()
Clears the selection of this Lookup
lookup.createPopUp(callback, [initialValue]) ⇒ plugins.window.FormPopup
plugins.window.FormPopup
Creates and returns a Popup Form to be used to show the lookup
Param | Type | Description |
---|---|---|
callback |
| The function that will be called when a selection is made; the callback returns the following arguments: {Array} record, {Array<String |
[initialValue] |
| And initial value to show in the search |
lookup.createWindow([x], [y], [width], [height], [jsWindowType]) ⇒ JSWindow
JSWindow
Returns: JSWindow
- returns a JSWindow which can be used to show the lookup in it using lookup.showWindow(window)
Param | Type | Description |
---|---|---|
[x] |
| |
[y] |
| |
[width] |
| The width of the pop-up. Optional. Default is component width |
[height] |
| The height of the pop-up. Optional. Default is form height. |
[jsWindowType] |
| Type of window; should be an option of JSWindow, Default JSWindow.MODAL_DIALOG |
lookup.getDataSource() ⇒ String
String
Gets the data source for this Lookup object
lookup.getField(index) ⇒ LookupField
LookupField
Gets the field at the specified index
Param | Type |
---|---|
index |
|
lookup.getFieldCount() ⇒ Number
Number
Gets the number of fields in the lookup object
lookup.getFoundSet() ⇒ JSFoundSet
JSFoundSet
Gets the foundset for this Lookup object.
lookup.getLookupDataProvider() ⇒ String
String
Gets the lookup dataprovider
lookup.getLookupForm() ⇒ [ 'RuntimeForm' ].<AbstractLookup>
[ 'RuntimeForm' ].<AbstractLookup>
Returns the Lookup form instance used
lookup.getParams() ⇒ Array
Array
Example
lookup.getSelectedRecords() ⇒ [ 'Array' ].<JSRecord>
[ 'Array' ].<JSRecord>
Returns the selected records for the lookup object Can be used to know which records have been previously selected by the user for this lookup
lookup.getSelectedValues() ⇒ [ 'Array' ].<JSRecord>
[ 'Array' ].<JSRecord>
Returns the selected values based on the lookupDataProvider based on the lookupFormProvider. Can be used to know which values have been previously selected by the user for this lookup.
throws an exception if the lookupDataProvider has not been set
lookup.removeField(index)
Removes a field at the specified index
Param | Type |
---|---|
index |
|
lookup.removeParam(index)
Removes a param at the specified index
Param | Type |
---|---|
index |
|
lookup.removeSelectedRecord(record)
Removes the given record from the list of selected records
Param | Type |
---|---|
record |
|
lookup.setLookupDataProvider(dataProvider)
Sets the lookup dataprovider Has to be a dataprovider or a related dataprovider of the lookup dataSource Setting the lookup dataprovider will return the selected dataprovider values in the lookup callback
Param | Type |
---|---|
dataProvider |
|
Example
lookup.setLookupForm(lookupForm)
Sets the lookup form used as template for the lookup popup/dialog The lookup form must extend the abstract form AbstractLookup
Param | Type |
---|---|
lookupForm |
|
Example
lookup.setMultiSelect(multiSelect) ⇒ Lookup
Lookup
Allows this Lookup to multi select records The lookup form used will be changed when the instance set does not match the multi select setting
Param | Type |
---|---|
multiSelect |
|
lookup.setSelectedPks(pks)
Sets the selected records of this Lookup from the given primary keys Can be used to restore the user's selection from a previous user's session
Param | Type |
---|---|
pks |
|
lookup.setSelectedRecords(records)
Sets the selected records of this Lookup Can be used to restore the user's selection from a previous user's session
Param | Type |
---|---|
records |
|
lookup.setSelectedValues(values)
Param | Type |
---|---|
values |
|
lookup.showModalWindow([callback], [x], [y], [width], [height], [initialValue]) ⇒ Array.<JSRecord>
| Array.<(String|Date|Number)>
Array.<JSRecord>
| Array.<(String|Date|Number)>
Shows the lookup in a modal Window
Returns: Array.<JSRecord>
| Array.<(String|Date|Number)>
- returns the selected records; if the lookupDataprovider has been set instead it returns the lookupDataprovider values on the selected records. Returns null if the window is closed without a selection or an empty selection
Param | Type | Description |
---|---|---|
[callback] |
| The function that will be called when a selection is made; the callback returns the following arguments: {Array} record, {Array<String |
[x] |
| |
[y] |
| |
[width] |
| The width of the lookup. Optional. Default is same as target component |
[height] |
| The height of the lookup. Optional. Default is implementation-specifc. |
[initialValue] |
| And initial value to show in the search |
lookup.showPopUp(callback, target, [width], [height], [initialValue])
Shows the lookup as a Popup Form
Param | Type | Description |
---|---|---|
callback |
| The function that will be called when a selection is made; the callback returns the following arguments: {Array} record, {Array<String |
target |
| The component to show relative to |
[width] |
| The width of the lookup. Optional. Default is same as target component |
[height] |
| The height of the lookup. Optional. Default is implementation-specifc. |
[initialValue] |
| And initial value to show in the search |
lookup.showWindow(win, [callback], [initialValue]) ⇒ Array.<JSRecord>
| Array.<(String|Date|Number)>
Array.<JSRecord>
| Array.<(String|Date|Number)>
Shows the lookup in a Window
Returns: Array.<JSRecord>
| Array.<(String|Date|Number)>
- returns the selected records; if the lookupDataprovider has been set instead it returns the lookupDataprovider values on the selected records. Returns null if the window is closed without a selection or an empty selection
Param | Type | Description |
---|---|---|
win |
| the JSWindow object to show |
[callback] |
| The function that will be called when a selection is made; the callback returns the following arguments: {Array} record, {Array<String |
[initialValue] |
| And initial value to show in the search |
new Lookup(datasource)
Param | Type |
---|---|
datasource |
|
createLookup(dataSource) ⇒ Lookup
Lookup
Creates a lookup object which can be used to show a pop-up form
Param | Type | Description |
---|---|---|
dataSource |
| The data source to lookup |
Example
createQueryLookup(qbSelect, [dsName], [overrideData]) ⇒ Lookup
Lookup
Creates a read only, in-memory datasource from the given query and creates a Lookup for that
Param | Type | Description |
---|---|---|
qbSelect |
| the query |
[dsName] |
| the name of the datasource in case it should be reused |
[overrideData] |
| when true, the datasource with the given name is filled again from the given query, when false, an existing datasource with the same datasource name would be reused; default is false |
Example