getDataFromPanel()
Description
Returns panel data using a polling model. Use this function to retrieve data from a specific panel.
Usage
panelData = m.lib.callFunc("getDataFromPanel", panelName)
Parameters
| Parameter | Type | Description |
|---|---|---|
panelName | string | Name of the panel to query |
Return Value
Returns an associative array containing the panel data. The structure depends on the panel type.
Example
' Get data from the key plays panel
sub getKeyPlaysData()
keyPlaysData = m.lib.callFunc("getDataFromPanel", "keyplays")
if keyPlaysData <> invalid then
print "Key Plays Count: " + keyPlaysData.count.toStr()
' Process the data...
else
print "No data available for key plays panel"
end if
end sub
' Get data from the stats panel
sub getStatsData()
statsData = m.lib.callFunc("getDataFromPanel", "stats")
if statsData <> invalid then
print "Stats Data: " + formatJson(statsData)
end if
end sub
Best Practices
- Check if the returned data is valid before using it
- Refer to panel-specific documentation for data structure
- Use polling sparingly to avoid performance issues
- Consider observing panel events instead of polling when possible