List View API
Overview
SolidX exposes a programmatic List View API so external components (for example popup actions, custom buttons, or widgets) can control an active list page.
This API is exposed through:
listViewRegistry(runtime registry of active list views)getListView(listId)(fetch one list handle)getRegisteredListViewIds()(inspect available list IDs)SolidListViewHandle(imperative methods on a list view instance)
Source of Truth
Implementation references:
src/routes/pages/admin/core/ListPage.tsxsrc/components/core/list/listViewRegistry.tssrc/components/core/list/SolidListView.tsx
How List Views Are Exposed
ListPage.tsx creates a list ID and registers the list handle on mount:
const listId = `page:${moduleName}:${modelName}:${menuItemId}:${menuItemName}:${actionId}:${actionName}`;
registerListView(listId, handle);
It unregisters on unmount:
unregisterListView(listId);
Important details:
modelNameis camel-cased inListPage.menuItemId,menuItemName,actionId, andactionNameare required parts of the ID.- Treat list IDs as fully-qualified keys; use exact matching instead of partial matching.
Registry API
import { getListView, getRegisteredListViewIds } from "@solidxai/core-ui";
Available functions:
getListView(listId)-> returnsSolidListViewHandle | undefinedgetRegisteredListViewIds()-> returnsstring[]hasListView(listId)-> boolean check (also exported)
SolidListViewHandle API
SolidListView exposes these imperative methods:
type SolidListViewHandle = {
refresh: () => void;
clearFilters: () => void;
applyFilter: (filter: {
custom_filter_predicate?: any;
search_predicate?: any;
saved_filter_predicate?: any;
predefined_search_predicate?: any;
}) => void;
setPagination: (nextFirst: number, nextRows: number) => void;
setSort: (nextMultiSortMeta: { field: string; order: 1 | -1 }[]) => void;
setShowArchived: (value: boolean) => void;
getState: () => {
first: number;
rows: number;
multiSortMeta: { field: string; order: 1 | -1 }[];
showArchived: boolean;
filters: any;
filterPredicates: any;
listData: any[];
totalRecords: number;
loading: boolean;
};
};
Typical External Usage
Pattern:
- Read registered IDs.
- Build the exact target
listIdfrom module/model/menu/action context. - Resolve handle via
getListView. - Invoke handle API (
applyFilter,refresh, etc.).
Example:
import { getListView, getRegisteredListViewIds } from "@solidxai/core-ui";
const listIds = getRegisteredListViewIds();
const listId =
"page:onboarding:applicationMaster:menu-123:Applications:action-456:open";
const listView = getListView(listId);
if (listView) {
listView.applyFilter({
custom_filter_predicate: {
$and: [
{
applicationNumber: { $in: matchingApplicationNumbers },
},
],
},
});
}
Filter Shape Notes
applyFilter(...) accepts predicate buckets used by the list search pipeline:
custom_filter_predicatesearch_predicatesaved_filter_predicatepredefined_search_predicate
These are merged into list filters internally, then converted into request query.
Troubleshooting
- List handle is
undefined-> list may not be mounted yet, or ID does not match the exact module/model/menu/action context. - No matching ID found -> inspect
getRegisteredListViewIds()output and verify every segment of the composed ID. - Filter call has no effect -> verify predicate structure and target model field names.
- Wrong target list updated -> use exact
listIdmatching only.