NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: GordonF on September 14, 2021, 07:18:55 AM
-
Is there a way to set DatePicker options globally so the default behaviour can be configured, for instance allowing year selection and a default year range, I can do this locally on each date field by setting the options but it would be nicer in my case to set defaults at a higher level and then override on the few occasions it is required.
Gordon
-
I do it in the ProcessLink embed.
If you are usging NT 12.25 becarefull that the calendar does not show the actual field date value.
This was reported to Bruce.
Regards
-
Hi Michelis,
Thank you for your reply, forgive my ignorance but what procedure is the processlink embed actually in and what does the code look like to set the datepicker global options.
Any help would be appreciated.
Regards
Gordon
-
Hi Gordon, no problem, ProcessLnk is a method inside WebHandler, simple go to Embed and found it, then you can embed someting like this:
Self.site.DateOptions = 'monthNames: [''Enero'', ''Febrero'', ''Marzo'', ''Abril'', ''Mayo'', ''Junio'', ''Julio'', ''Agosto'', ''Setiembre'', ''Octubre'', ''Noviembre'', ''Diciembre'']'&|
',monthNamesShort: [''Ene'', ''Feb'', ''Mar'', ''Abr'', ''May'', ''Jun'', ''Jul'', ''Ago'', ''Set'', ''Oct'', ''Nov'', ''Dic'']'&|
',dayNamesMin: [''Do'', ''Lu'', ''Ma'', ''Mi'', ''Ju'', ''Vi'', ''Sa'']'&|
',dayNamesShort: [''Dom'', ''Lun'', ''Mar'', ''Mie'', ''Jue'', ''Vie'', ''Sab'']'&|
',closeText: ''Cancelar'''&|
',currentText: ''Hoy'''&|
',dateFormat: ''dd/mm/yy'''&|
',nextText: ''Pr?ximo'''&|
',prevText: ''Anterior'''&|
',dayNames:[''Domingo'', ''Lunes'', ''Martes'', ''Miercoles'', ''Jueves'', ''Viernes'', ''Sabado'']'&|
',numberOfMonths: 3'&|
',firstDay: 7'&|
',showWeek: true'&|
',noWeekends: true'&|
',maxDate: ''+3M'''&|
',duration: ''fast'''&|
',weekHeader: ''S'''&|
',showCurrentAtPos: 1'&|
''
-
Hi Gordon,
for the possible options to the date picker (ie the options that Alberto is using below) see
https://api.jqueryui.com/datepicker/
There are a LOT of possible options, so you can do whatever you like.
Alberto: Unfortunately I have not been able to duplicate the issue that you reported. It may be related to one of the options you are using. From your report it is not clear if the error only occurs with your global options setting? or if it happens without the options?
Cheers
Bruce
-
Bruce, just compile the web1 nt example in NT11 and NT12 without any change.
When you get the calendar in NT11, it has the date selected OK and when you press Today it is selected OK and in another colour.
When you get the calendar in NT12, it has NOT the date selected, and when you press Today it is selected OK but in the selected colour.
Please see pics
-
Thank you to both of you for your help I'm very grateful.
Gordon
-
thanks Alberto - fixed for 12.26
-
Hi Alberto, when I include the option
',showCurrentAtPos: 1'&|
The previous button no longer works, have you seen the same thing? If I remove it then all is well and position 1 appears to be the default behaviour.
Gordon
-
Hi Gordon, as Bruce said...
for the possible options to the date picker (ie the options that Alberto is using below) see
https://api.jqueryui.com/datepicker/
Regards