jQuery UI: started on option getters / setters

This commit is contained in:
John Reilly
2014-04-16 16:20:59 +01:00
parent 9480db2645
commit 042c9c7346
2 changed files with 32 additions and 5 deletions
+13 -2
View File
@@ -1159,10 +1159,21 @@ function test_datepicker() {
$(".selector").datepicker({ altField: "#actualDate" });
// getter
var altField = $(".selector").datepicker("option", "altField");
var altField: any = $(".selector").datepicker("option", "altField");
// setter
$(".selector").datepicker("option", "altField", "#actualDate");
var $set: JQuery = $(".selector").datepicker("option", "altField", "#actualDate");
}
// Options
function altFormat() {
$(".selector").datepicker({ altFormat: "yy-mm-dd" });
// getter
var altFormat: string = $(".selector").datepicker("option", "altFormat");
// setter
var $set: JQuery = $(".selector").datepicker("option", "altFormat", "yy-mm-dd");
}
}
+19 -3
View File
@@ -952,7 +952,7 @@ interface JQuery {
* @param optionName 'altField'
* @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
*/
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: string): any;
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: string): JQuery;
/**
* Set the altField option, after initialization
*
@@ -960,7 +960,7 @@ interface JQuery {
* @param optionName 'altField'
* @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
*/
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: JQuery): any;
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: JQuery): JQuery;
/**
* Set the altField option, after initialization
*
@@ -968,7 +968,23 @@ interface JQuery {
* @param optionName 'altField'
* @param altFieldValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
*/
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: Element): any;
datepicker(methodName: 'option', optionName: 'altField', altFieldValue: Element): JQuery;
/**
* Get the altFormat option, after initialization
*
* @param methodName 'option'
* @param optionName 'altFormat'
*/
datepicker(methodName: 'option', optionName: 'altFormat'): string;
/**
* Set the altFormat option, after initialization
*
* @param methodName 'option'
* @param optionName 'altFormat'
* @param altFormatValue An input element that is to be updated with the selected date from the datepicker. Use the altFormat option to change the format of the date within this field. Leave as blank for no alternate field.
*/
datepicker(methodName: 'option', optionName: 'altFormat', altFormatValue: string): JQuery;
/**
* Gets the value currently associated with the specified optionName.