Spreedsheet's object script

yuri1969 shared this question 5 years ago
Answered

Hi!

I have an object in A1, and the script OnClick B1 = If [B1 == 0,1,0]. I would like to have a similar relationship between A2 and B2, A3 and B3, etc.

In total, it is always a few dozen objects. Copy the script is very labor intensive. Is there a faster way?

Thanks for your help.

Comments (3)

photo
1

Hi,


An example in the attachment.


For adapt for your problem:

- copy the global javascript (allow to read or write all properties of objects)


- adapt and rename object "ScriptB". In this script-list is the sample for all scripts there must be executed.

the first command in "ScriptB" is fix. He need the Object "row",

"row" is a variable for the next command(s) in "ScriptB"

command 2 and higher is what you want change in the Table

you can adress a cell relativ to the actual click (or update)

Example: "C"+row+""


- adapt the script in the button:

Table-Column with the generated scripts in Line 2: Example "B"

Type of objects in Line 4: Example "point"

Name of script-list in Line 5: Example "ScriptB"

Type of the script in Line 6 (3.parameter): "val" for "OnClick" or "onUpdate" for "OnUpdate"


Raymond


Note:

An improved version is under development (about 1 day).

In this version, no changes in the java-script will be necessary.

https://ggbm.at/565501

photo
1

Hi


As attachment the improved version of 'D1'.

The documentation is included in the file.


Raymond


Change 15.02.14 Version D to D1

https://ggbm.at/565519

photo
1

THANKS ;-D

© 2019 International GeoGebra Institute