Promotic
Login logon

onAction - event of the PmfTable object

Description:
The event is triggered when an important logical action happens over the object.
Parameters:
ev(Object) Reference to an object that describes information about the event
Parameters:
ev.SrcObject(Object) Pmf object where the event originated.
ev.Action(String) Action type.
"main" - A click or left mouse button double-click, or pressing the Space or Enter key above the table. Mouse or keyboard actions that trigger onAction event -> "main", can be configured using the MainActionType property.
ev.Area(Long) The numeric identifier of the table area where the action was executed. See Areas in the table.
ev.Row(Long) Row index of the table where the action was executed.
ev.Col(Long) Column index of the table where the action was executed. If SelType = "row" and the action was initiated by the "space" or "Enter" then ev.Col = -1.
ev.Reason(String) The mouse or keyboard event that triggered the onAction event
"Click" - The event is triggered by left mouse button clicking.
"DblClick" - The event is triggered by left mouse button double-clicking.
"Space" - The event is triggered by pressing the Space key.
"Enter" - The event is triggered by pressing the Enter key.
Note:
This event is is functional only in JavaScript language.
See also:
Example:
Script for example in the onFormLoad event of the PmgForm object:
JavaScriptSelect and copy to clipboard

var oForm = pMe.Form;
var oTable = oForm.CreateItem("table", "id_tab1");
oTable.InitRows(5, 1, 1);
oTable.InitCols(6, 1);
// ... Additional table settings

// The function is registered into the onAction event.
function onTableAction(ev)
{
if (ev.Action == "main")
{
Pm.Debug("Area=" + ev.Area + ", Row=" + ev.Row);
switch (ev.Reason)
{
case "Click":
// ... script for the "Click" action
break;
case "DblClick":
case "Enter":
// ... common script for the "DblClick" or "Enter" action
break;
}
}
}
oTable.AddEvent("onAction", "Id_Edit", onTableAction);

History:
Pm9.00.35: New ev.Reason parameter.
PROMOTIC 9.0.34 SCADA system documentation MICROSYS, spol. s r.o.

Send page remark Contact responsible person
© MICROSYS, spol. s r.o.Update cookies preferences