Andres Aguilar
Posts: 0
Joined: Tue Apr 09, 2013 10:36 pm

Datepicker syntax

Hi everyone, I have a question, I asked a month ago about setting a date in the datepicker and other configurations and I received this useful response:
Appery('periodDatepicker').datepicker_dataPickerOptions.defaultDate = date;
Now I want to listen to a date being selected on the calendar. I think you are using a version of JQuery UI Datepicker http://jqueryui.com/datepicker/
On a normal usage of this calendar, the event would be
$('.datepicker').datepicker("onSelect",function(){});
How could I do the same with the Appery syntax? Maybe you can explain what are you doing when you use .datepicker_dataPickerOptions. Thanks in advance, hope I explained myself.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Datepicker syntax

Try using the same code (you might need to modify the selector). There is no Appery.io syntax, you use JavaScript.

Andres Aguilar
Posts: 0
Joined: Tue Apr 09, 2013 10:36 pm

Datepicker syntax

Thanks for your time, Could you tell me exactly what the selector could be? I already tried with dsid=periodDatepicker or the input, but none seems to do the trick. Here's what the datepicker looks like on display

<div data-role="fieldcontain" id="j_89" dsid="periodDatepicker" name="periodDatepicker" tiggzitype="object" apperytype="object" apperyclass="datepicker" tiggziclass="datepicker" data-theme="a" class="period-datepicker mobiledatepicker1 ui-field-contain ui-body ui-br"><div class="datePickerControls" style="width: 228px;">
<a title="Open Date Picker" class="datepickeropenbutton ui-input-clear ui-btn ui-body ui-body-a ui-btn-icon-notext ui-btn-corner-all ui-shadow ui-btn-up-a" href="#" data-theme="a" style="margin-top:3px; vertical-align: middle; display: inline-block;">
<span class="ui-btn-inner ui-btn-corner-all">
<span class="ui-btn-text">Open Date Picker</span>
<span class="ui-icon ui-icon-grid ui-icon-shadow"></span>
</span>
</a>
<div class="inputContainer">
<div class="ui-input-text ui-shadow-inset ui-corner-all ui-btn-shadow ui-body-a">
<input type="text" data-theme="a" value="" class="ui-input-text ui-body-a" readonly="readonly"
<>
<>
<><div id="dp1369066524975" class="hasDatepicker">...<><>

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Datepicker syntax

Hi Andres,

You would need to use Datepicker component Value change event. The event object is got as the argument there.

Inside the object there is target - a reference to the input field, where at the time of the call handler that date has already been updated.

Appery.io does not pass the event object. That is, you would need to call
arguments [0]. target

You can get a new date as a string within a handler:
codevar new_value = $ (arguments [0]&#46; target)&#46; val ();/code

Return to “Issues”