audreyt / ethercalc

Node.js port of Multi-user SocialCalc
https://ethercalc.net
Other
2.96k stars 537 forks source link

'Panels' in forms and formulae of textbox inputs #551

Open aaist opened 7 years ago

aaist commented 7 years ago

I'm looking to produce an ethercalc form on my LAN which has a landing screen with a few button options, and clicking on each option shows a different part of the spreadsheet with textbox fields just below. This is to capture scores from different individuals so each individual doesn't need to have one large form with every field. I have seen similar things done using the PANEL function (and I can control what I see using =SPLASH), but I am quite an amateur with this and am not sure how to control the showing/hiding of parts of the sheet. Any help at all would be hugely appreciated.

Another question - I wish to do a simple formula on the inputs of two of the textbox fields in the form on the main sheet (just an average of the two numbers that are put in). If I try to =A1+A2 with the textboxs, it returns a #VALUE error. How do I get the data in these boxes to be calculated on in the spreadsheet?

Thank you.

eddyparkinson commented 7 years ago

Panel

example: http://sheet.cellmaster.com.au/example_panel/appeditor

Put one panel under another on the sheet. This is because it hides rows/cols of the sheet. The panels need to be lined up so that hiding row/cols is able to produce the result you want.

Let me know if you need more details.

Value error


A1 =textbox("23.5")

=1*A1 //gives 23.1 =int(A1) // gives 23 =""&A1 // gives '23.5'

see http://sheet.cellmaster.com.au/example_textbox/appeditor

Note =A1 will clone the type, which is of type "GUI"- Other types: date or time or number or string. Because the type is GUI, you get a strange result. You need to change the type using a formula of some kind.

Auto detect type - I did not add code to auto detect types, sorry.

All GUI Features

Demos almost all the features http://sheet.cellmaster.com.au/carbonoffset/appeditor

GUI Examples (input widgets, styles, forms)

http://sheet.cellmaster.com.au/examples

aaist commented 7 years ago

Hi Eddy,

Thank you so much for this, I am incredibly grateful for your help. That second part explaining how to display the textbox entry as a number works fantastically and has helped immensely with the functioning of the form.

The panel example you sent seemed to work fine in testing, but I have managed to break your example and am unable to fix it back to review my error. I am sorry about this.

What I need the panel function to do specifically is to have a form with a few buttons at the top, as follows: PM, E1, E2, E3, E4, H1, H2 etc. - these are basic labels for judges who would each have their own scoring 'form'. Clicking on these then shows part of the form relating to that judge. These are vertical columns all in a row and go something like this:

PM - C3:K26 E1 - M3:P25 E3 - Q3:T26

I can't seem to work out how to relate a button/panel to each section and be able to show just this part by clicking on the button at the top of the form. While your example seemed to show something just like this with interchangeable buttons, I couldn't make it work with vertical sections and then unfortunately lost the function altogether.

I hope you can still help, and apologies for my limited knowledge with how this function works.

eddyparkinson commented 7 years ago

Buttons

Buttons change sheet values. The do this via action formulae - see cells B2 & C2 http://sheet.cellmaster.com.au/example_button/appeditor

Panel example

Fixed and added comments http://sheet.cellmaster.com.au/example_panel/appeditor

aaist commented 7 years ago

Thank you, I think I understand now - testing the horizontal panels seems to work fine that way. I did however try it with vertical panels which I require, and the correct sections do not display in the right place. It also doesn't seem to show the first panel in the right place, despite me confining the visible cells using the formula structure you provided.

I have left my attempt on that example - can you please see what I did and let me know why it is showing like this, and not in the panel ranges I have specified?

Thank you again!

eddyparkinson commented 7 years ago

Looks like there is a but with vertical. Not sure what. But it is only working if I change the numbers right to left, and even the the end one fails.

enemali commented 6 years ago

All links above doesn't seems to work , anyone experiencing the same thing? Any alternative GUI examples?

eddyparkinson commented 6 years ago

New Server I will fix at some point. Need to find another server.

Open shift changed to $50 USD a month - which is on the expensive end.

Panel example https://ethercalc.org/example_panel https://ethercalc.org/example_panel/app

Examples https://ethercalc.org/examples

What examples are you looking for ? I can paste some if you need.

enemali commented 6 years ago

Thanks @eddyparkinson you have always help in answering issues here . If you have the time i will appreciate if i can see some working examples on the following formulas COMMAND( ) COMMANDIF( ) DELETEIF( ) COPYFORMULA( ) SPLASH( ) INSERT( )

Thanks for your efforts

eddyparkinson commented 6 years ago

COMMAND() & COPYVALUE() https://ethercalc.org/example_command

DELETEIF( ), INSERT( ), TEXTBOX(), BUTTON(), SPLASH() CHECKBOX() sheet: https://ethercalc.org/example_deleteif app: https://ethercalc.org/example_deleteif/app

insert() is complex - as the data to copy can be formulas or values. e.g. =INSERT(D2,B6:B10,F2,G2)
F2: the formula in F2 is copied G2: the value in G2 is copied. you can list as many formula/value ranges as you want, e.g. =INSERT(D2,B6:B10,F2,G2, formularange, valuerange, ...)

SPLASH() must but first - I think A1 and used with panel. If panel is missing then you will only see the splash loading cells.

COMMANDIF() & COPYFORMULA( ) COMMANDIF( ) - the 2nd param needs to be true or false, and will only execute the command if true.

COPYFORMULA( ) - like COPYVALUE above - will copy a formula when the trigger button is pressed.

enemali commented 6 years ago

Thanks so much @eddyparkinson you really helped me to know/like ethercalc more . keep it up

freemin7 commented 6 months ago

All those examples are dead by now. Where can i learn how those functions were meant to be used?