The context object provides a powerful interface for accessing data and performing actions within the Report Static Query Builder. It's available globally as window.context and contains several key components.
Structure Overview
{params:{},// Query parameterstable:{},// Available tables with dataflow:Function,// Load or open a flowform:Function,// Open a formquery:{}// Query builder object}
Components
params
The params object contains all query parameters available to the current report.
context.flow({
flowId: "flow123", // Required: ID of the flow to load
executionType: "loadFlow", // Required: "loadFlow" or "openFlow"
reloadCurrentFlow: true, // Optional: Whether to reload the current page after loading the flow
reloadCurrentContent: true, // Optional: Whether to reload the current content after loading the flow
resetParams: false, // Optional: Whether to reset params to default after loading the flow
params: [ // Optional: Parameters to pass to the flow
{
paramName: "userId",
paramValue: "12345"
},
{
paramName: "view",
paramValue: "detailed"
}
]
});
context.form({
formId: "form123", // Required: ID of the form to open
params: [ // Optional: Parameters to pass to the form
{
paramName: "userId",
paramValue: "12345"
},
{
paramName: "mode",
paramValue: "edit"
}
]
});
// Open an edit form for the first product in the table
context.form({
formId: "productEditForm",
params: [
{
paramName: "productId",
paramValue: context.table.products[0].id
},
{
paramName: "category",
paramValue: context.params.currentCategory
}
]
});
// Update data in the background and then refresh the current view
context.flow({
flowId: "dataUpdateFlow",
executionType: "loadFlow",
reloadCurrentFlow: true,
reloadCurrentContent: true,
resetParams: false
});