Page 1 of 1

Custom Javascript Formatter in Binding Dialog

Posted: Fri Oct 22, 2021 2:37 pm
by mcorbo
I have a subfile being used for data entry. After entry, when displaying the data, I would like to use custom formats to display the numeric data. Record 1 might have 2 decimal places, record 2 none, record 3, 3 decimals etc. Each column would represent a day of the week and be bound to a Numeric 11,3 field.

I see that you can provide a custom javascript formatter in the binding dialog, but where do you put the javascipt? The documentation really doesn't go into much detail. Is it possible to provide the custom formatting for each row in the subfile?

I just want to format the data, not validate it.

Re: Custom Javascript Formatter in Binding Dialog

Posted: Mon Oct 25, 2021 2:52 pm
by Scott Klement
You just have to make sure your JavaScript function is defined. It doesn't matter where you put it, as long as it'll load and be defined at the right time.

Examples:

1) You could place a .js file in userdata/custom (or one of its subdirectories) if you plan to use this with the RDF launcher and/or designer.
2) You could place it anywhere and link it into your start.html file
3) You could load it with the "external javascript" property.

It doesn't really matter, as long as it's defined before you need it.