Returns RunnerPage object specified by ItemId.
Syntax
DashboardPage.getElementPage(itemId)
Arguments
itemId
ItemID as it appears in the Page Designer. How to find ItemID?
sub
pageType or table name.
- For a regular grid, chart or report this parameter is not required.
- For a single record element use pageType like "add" or "edit1". pageType is the name of the page as it appears in the Page Designer.
- For details table element use details table name
Return value
RunnerPage object, that represents the dashboard element, specified by itemId.
Example 1
For instance, we have added a button to the grid in the dashboard, that modifies some data in the underlying table. To refresh the grid without reloading the whole dashboard, we add the following code to button's ClientAfter event. Make sure to replace "orders_list" with ItemID of your dashboard element.
var page = Runner.dashboard.getElementPage("orders_list");
page.reload({a:'reload'});
Example 2
In this example we will get single record element of the same table and hide EmployeeID control on the Edit tab.
var page = Runner.dashboard.getElementPage("orders_single", "edit");
page.hideField("EmployeeID");
Example 3
This example doesn't rely on Dashboards API but it belongs here. It shows how to hide or show the whole dashboard element programmatically.
Show:
Runner.dashboard.toggleItem("orders_single", true);
Hide:
Runner.dashboard.toggleItem("orders_single", false);
See also: