API svyNavigation
Classes
Functions
addNavigationListener(listener)
createNavigationItem([formName], [text], [tooltipText]) ⇒ NavigationItem
Creates a NavigationItem object to the given formName
getCurrentItem() ⇒ NavigationItem
getVersion() ⇒ String
Gets the version of this module
open(itemOrID, [dataToShow], [dataSelectionType]) ⇒ Boolean
Opens the navigation item. If the item already exists in the stack, then all items after the specified item are closed beforeClose event will be fired allowing a chance to react or cancel afterOpen will fire allowing UIs to update
removeNavigationListener(listener) ⇒ Boolean
NavigationItem
.getCustomData() ⇒
*
.getFormName() ⇒
String
.getID() ⇒
String
.getText() ⇒
String
.getTooltipText() ⇒
String
navigationItem.getCustomData() ⇒ *
*
Example
navigationItem.getFormName() ⇒ String
String
Gets the name of the form associated with this navigation item.
navigationItem.getID() ⇒ String
String
navigationItem.getText() ⇒ String
String
navigationItem.getTooltipText() ⇒ String
String
navigationItem.setCustomData(customData) ⇒ NavigationItem
NavigationItem
customData
*
Example
navigationItem.setFormName(formName) ⇒ NavigationItem
NavigationItem
Sets the name of the form associated with this navigation item.
formName
String
navigationItem.setText(text) ⇒ NavigationItem
NavigationItem
text
String
navigationItem.setTooltipText(tooltipText) ⇒ NavigationItem
NavigationItem
tooltipText
String
navigationItem.stringify()
new NavigationItem([formName], [text], [tooltipText])
[formName]
String
[text]
String
[tooltipText]
String
NAVIGATION_EVENT
Properties
BEFORE_CLOSE
before-close
register for navigation event to listen for this event (@see addNavigationListener) beforeClose event will be fired before navigating allowing a chance to react or cancel
AFTER_OPEN
after-open
register for navigation event to listen for this event (@see addNavigationListener) afterOpen event will be fired when a navigation item has been opened; react to the after_open event to implement your navigation
NAVIGATION_SELECTION_TYPE
Enumeration for the data selection type specified in the open function. The chosen selection type is passed to the open function [open](@link open) [afterOpen](@link afterOpen) and needs to be implemented accordingly. The Default value is LOAD_RECORDS
See: open(itemOrId, dataToShow, dataSelectionType) Properties
LOAD_RECORDS
load-records
This is the DEFAULT selection type. Will run foundset.loadRecords(dataToShow) on the form to be shown. Load records into the form's foundset. If you load a relation into this foundset, then this foundset will not be a related foundset, it will not automatically update its state of records are updated or added that belong to that relation. It will only be a snapshot of that related foundsets state. Foundset filter params are copied over from the source foundset and are merged with the existing filters on this foundset.
SET_FOUNDSET
set-foundset
Can be used only when the dataToShow is of type JSFoundSet. Will run controller.loadRecords(dataToShow) for the target form. Replace the default form's foundset with setting the (related) foundset into the form. The form will no longer share the default foundset with forms of the same datasource, use loadAllRecords to restore the default foundset. This will really update the foundset instance itself of the form, so now existing foundset is altered just the new foundset is shown. When the form uses a seperate foundset, foundset filter params are copied over from the source foundset and are merged with the existing filters.
SELECT_RECORD
select-record
Can be used only when the dataToShow is a JSRecord. Selects the record with the given pk in the foundset even if the record is not loaded in foundset yet. Warning: can be very expensive, as the entire foundset may needs to be loaded. Returns false if the record cannot be found in the entire foundset.
FORCE_SELECT_RECORD
force-select-record
Can be used only when the dataToShow is a JSRecord. Selects the record with the given pk in the foundset even if the record is not loaded in foundset yet. Warning: can be very expensive, as the entire foundset may needs to be loaded. Returns false if the record cannot be found in the entire foundset. If the record is not present in the foundset will force the selection by loading all records into the foundset. If there are active foundset or table filters these won't be removed, they will still apply.
addNavigationListener(listener)
listener
function
Example
createNavigationItem([formName], [text], [tooltipText]) ⇒ NavigationItem
NavigationItem
Creates a NavigationItem object to the given formName
[formName]
String
[text]
String
[tooltipText]
String
getCurrentItem() ⇒ NavigationItem
NavigationItem
getVersion() ⇒ String
String
Gets the version of this module
Returns: String
- the version of the module using the format Major.Minor.Revision
open(itemOrID, [dataToShow], [dataSelectionType]) ⇒ Boolean
Boolean
Opens the navigation item. If the item already exists in the stack, then all items after the specified item are closed beforeClose event will be fired allowing a chance to react or cancel afterOpen will fire allowing UIs to update
[dataToShow]
JSRecord
| JSFoundSet
| QBSelect
The data to show for the given navigation item. The data is passed to the afterOpen event
[dataSelectionType]
String
Determine the type of selection in the target navigation item with the given dataToShow NAVIGATION_SELECTION_TYPE enumeration options. The chosen selection type is passed to the afterOpen and needs to be implemented accordingly. Default NAVIGATION_SELECTION_TYPE.LOAD_RECORDS
Example
removeNavigationListener(listener) ⇒ Boolean
Boolean
listener
function
Example
Last updated