MenuFoundSet
Last updated
Was this helpful?
Last updated
Was this helpful?
MenuFoundSet
enables a menu structure to function as a datasource, allowing menu items to be treated as records within the Servoy Developer environment. This provides access to menu properties as dataproviders, which are read-only, and supports hierarchical relationships, such as parent-child structures based on parentid
. These capabilities allow components like to work seamlessly with menu records and enable complex menu representations with FormComponents.
For further details on setting up and working with datasources, see .
Iterates over the records of a foundset taking into account inserts and deletes that may happen at the same time.
Iterates over the records of a foundset taking into account inserts and deletes that may happen at the same time.
Returns the datasource (menu:name) for this MenuFoundSet.
Get foundset name (menu name).
Get the MenuItemRecord object at the given index.
Get the index of a record object inside a foundset
Get the record index.
Get the current record index of the foundset.
Get the indexes of the selected records.
Get the selected records.
Get the number of records in this menu foundset.
void
Set the current record index.
void
Set the selected records indexes.
Iterates over the records of a foundset taking into account inserts and deletes that may happen at the same time. It will dynamically load all records in the foundset (using Servoy lazy loading mechanism). If callback function returns a non null value the traversal will be stopped and that value is returned. If no value is returned all records of the foundset will be traversed. Foundset modifications( like sort, omit...) cannot be performed in the callback function. If foundset is modified an exception will be thrown. This exception will also happen if a refresh happens because of a rollback call for records on this datasource when iterating. When an exception is thrown from the callback function, the iteration over the foundset will be stopped.
Parameters
Sample
Iterates over the records of a foundset taking into account inserts and deletes that may happen at the same time. It will dynamically load all records in the foundset (using Servoy lazy loading mechanism). If callback function returns a non null value the traversal will be stopped and that value is returned. If no value is returned all records of the foundset will be traversed. Foundset modifications( like sort, omit...) cannot be performed in the callback function. If foundset is modified an exception will be thrown. This exception will also happen if a refresh happens because of a rollback call for records on this datasource when iterating. When an exception is thrown from the callback function, the iteration over the foundset will be stopped.
Parameters
Sample
Returns the datasource (menu:name) for this MenuFoundSet.
Sample
Get foundset name (menu name).
Sample
Get the MenuItemRecord object at the given index. Argument "index" is 1 based (so first record is 1).
Parameters
Sample
Get the index of a record object inside a foundset
Parameters
Get the record index. Will return -1 if the record can't be found.
Parameters
Sample
Get the current record index of the foundset.
Sample
Get the indexes of the selected records. When the foundset is in multiSelect mode (see property multiSelect), a selection can consist of more than one index.
Sample
Get the selected records. When the menu foundset is in multiSelect mode (see property multiSelect), selection can be a more than 1 record.
Sample
Get the number of records in this menu foundset. All records are loaded when foundset is initialized.
Sample
Set the current record index.
Parameters
Returns: void
Sample
Set the selected records indexes.
Parameters
Returns: void
Sample
Type true if the MenuFoundSet is in multi-select mode; false otherwise.
callback The callback function to be called for each loaded record in the foundset. Can receive three parameters: the record to be processed, the index of the record in the foundset, and the foundset that is traversed.
Returns: Object the return value of the callback
callback The callback function to be called for each loaded record in the foundset. Can receive three parameters: the record to be processed, the index of the record in the foundset, and the foundset that is traversed.
thisObject What the this object should be in the callback function (default it is the foundset)
Returns: Object the return value of the callback
Returns: The datasource identifier for this MenuFoundSet in the format menu:name.
Returns: name.
index record index (1 based).
Returns: MenuItemRecord record.
record the records object
Returns: the index or -1 if not present (anymore)
record MenuItemRecord
Returns: int index.
Returns: int current index (1-based)
Returns: Array current indexes (1-based)
Returns: the currently selected record, or null if no record is selected.
Returns: Array current records.
Returns: int current size.
index index to set (1-based)
indexes An array with indexes to set.