Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

By default, the Date field displays the date picker when end-users click on the Date field text box or the calendar icon. In case, if you need to display the date picker when the Date field is in focus, you can achieve that in any of the following two configurations:

1. Application-level (Global Configuration):

Info

This code can be used in any listener file, not necessarily form's listener file. However, once this code is implemented, it will reflect globally at the application level. 

Code Block
languagejs
canvas.env.options.form.ShowDatePickerOnFocus ='true';
/* Here,
*  'true' indicates that when Date field is in focus, 
*  the date picker is displayed. 
*  'false' indicates that when Date field is in focus,
*  the date picker is not displayed.
*/

2. Form Item-level:

Info

This code must be used in the form’s listener JS file. 

Code Block
this.fm.registerHandler("cbxpreinitialize", 
function(fm, event, fieldName, value) 
{
  return
  {
    'DATE_FIELD': // Item ID of Date field.
    {
      'showDatePickerOnFocus' : true // Displays date picker when Date field is in focus.
    }
  }
}