CellOnClick

Revision as of 18:25, 22 September 2018 by Lchrisman (talk | contribs) (Added some 5.2 content)




Release:

4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3  •  6.4  •  6.5  •  6.6


CellOnClick( expr )

A cell format predicate that specifies an expression to be evaluated when a user double-clicks on a table cell (for example in a result table). This can be configured from within a computed cell format in the Cell Format Expression attribute. The expression «expr» is allowed to have side-effects, such as assignments to global variables, in the same way an OnClick or OnChange expression can.

Use this function when you want to enable do some custom action when a user double-clicks on a particular cell in a result table. This behaves similarly to having a Button inside a table.

{{Release|5.2||

Coordinates of the cell

New to [[Analytica 5.2]

In some cases, you may want to know the coordinates of the cell that was clicked from within «expr». In most cases, the coordinate of the cell is the value of each index of the table at that cell. This is available within «expr» by simply referring to the index by name in a value context. For example, when In1 is an index, the expression

MsgBox(In1)

would show an array of values. But from within «expr», CellOnClick(MsgBox(In1)) would show the single index element from In1 corresponding to the cell that was clicked. All indexes appearing in the table, whether horizontal or vertical indexes, or a slicer index with a single value selected, behaves in this fashion.

}}

Examples

With the following Cell Format Expression, when the user double-clicks on any cell in the I='b' row of the result table, the user interface will open the influence diagram for the module Mo1.

If I='b' Then CellOnClick( ShowWindow( Handle(Mo1), 'Diagram' ) )

When the user clicks on any cell in the table, a message box shows the value at full precision.

CellOnClick( MsgBox( NumberToText(Self,fullPrecision:true) ) )

See Also

Comments


You are not allowed to post comments.