KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Masking fields using Javascript Callbacks
PRODUCT: 4D Web 2.0 Pack | VERSION: 1.1 | PLATFORM: Mac & Win
Published On: September 5, 2007

PLEASE NOTE: This Tech Tip applies to 4D Web 2.0 Pack version 1.1

A 4D Ajax Framework object such as a Data Grid may contain sensitive information that you may not want to be displayed. For example, perhaps your grid has a field containing Social Security Numbers. One solution to this problem is mask the Social Security number field when the Data Grid is loaded. This can happen by using Javascript Callbacks.

Javascript Callback events are specified in the file 'callbacks.js' found in /dax/js/callbacks.js. One particular callback is named callback_OnViewQuery and it is triggered when a Calendar, Data Grid, or Data Tree are displayed.

Feel free to edit 'callbacks.js' and add your own code to function callback_OnViewQuery to handle this situation. Fortunately, example code for masking a field is already provided in callbacks.js within the function callback_OnViewQuery. The example is simply commented out.

For the latest information the 4D Ajax Framework please see the Daxipedia:

http://daxipedia.4d.com