Extensions

Press shift + S to search API reference.

Model

ViewMetadataQueryResult

View source

Contains information about a view that isn't loaded by default e.g. field order and visible fields.

In a React component, we recommend using useViewMetadata instead.

async function loadMetadataForViewAsync(view) {
const viewMetadata = view.selectMetadata();
await viewMetadata.loadDataAsync();
console.log(viewMetadata.visibleFields);
// => [Field, Field, Field]
console.log(viewMetadata.allFields);
// => [Field, Field, Field, Field, Field]
viewMetadata.unloadData();
}

Members

class ViewMetadataQueryResult extends AbstractModelWithAsyncData<ViewMetadata, WatchableViewMetadataKey>
readonly allFieldsArray<Field>

Returns every field in the table in the order they appear in this view. Watchable.

readonly idstring

The ID for this model.

readonly isDataLoadedboolean
readonly isDeletedboolean
readonly visibleFieldsArray<Field>

Returns every field visible in this view. Watchable.

parentViewView
loadDataAsync
function () => Promise<void>

Will cause all the async data to be fetched and retained. Every call to loadDataAsync should have a matching call to unloadData.

Returns a Promise that will resolve once the data is loaded.

toString
function () => string

A string representation of the model for use in debugging.

unloadData
function () => void
unwatch
function (keys: WatchableViewMetadataKey | ReadonlyArray<WatchableViewMetadataKey>, callback: FlowAnyFunction, context?: FlowAnyObject | null) => Array<WatchableViewMetadataKey>

Unwatching a key that needs to load data asynchronously will automatically cause the data to be released. Once the data is available, the callback will be called.

watch
function (keys: WatchableViewMetadataKey | ReadonlyArray<WatchableViewMetadataKey>, callback: FlowAnyFunction, context?: FlowAnyObject | null) => Array<WatchableViewMetadataKey>

Watching a key that needs to load data asynchronously will automatically cause the data to be fetched. Once the data is available, the callback will be called.