Custom Javascript Formatter in Binding Dialog

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
mcorbo
Profound User
Posts: 20
Joined: Fri Sep 08, 2017 8:14 am
First Name: Michael
Last Name: Corbo
Company Name: National Retail Systems
Phone: 2018042713
Address 1: 600 us rt 46w
City: Hasbrouck Heights
State / Province: New Jersey
Zip / Postal Code: 07601
Country: United States
Contact:

Custom Javascript Formatter in Binding Dialog

Post 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.
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: Custom Javascript Formatter in Binding Dialog

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests