首页 新闻 赞助 找找看

怎么调用 onSelect 方法和给参数赋值????

0
悬赏园豆:10 [待解决问题]

(function ($, undefined) {
    $.widget("mobile.date", {
        options: {
            defaultDate: null, // Used when field is blank: actual date,
            // +/-number for offset from today, null for today
            appendText: "", // Display text following the input box, e.g. showing the format
            buttonText: "...", // Text for trigger button
            buttonImage: "", // URL for trigger button image
            buttonImageOnly: false, // True if the image appears alone, false if it appears on a button
            hideIfNoPrevNext: false, // True to hide next/previous month links
            // if not applicable, false to just disable them
            navigationAsDateFormat: false, // True if date formatting applied to prev/today/next links
            gotoCurrent: false, // True if today link goes back to current selection instead
            changeMonth: false, // True if month can be selected directly, false if only prev/next
            changeYear: false, // True if year can be selected directly, false if only prev/next
            yearRange: "c-10:c+10", // Range of years to display in drop-down,
            // either relative to today's year (-nn:+nn), relative to currently displayed year
            // (c-nn:c+nn), absolute (nnnn:nnnn), or a combination of the above (nnnn:-n)
            showOtherMonths: false, // True to show dates in other months, false to leave blank
            selectOtherMonths: false, // True to allow selection of dates in other months, false for unselectable
            showWeek: false, // True to show week of the year, false to not show it
            calculateWeek: this.iso8601Week, // How to calculate the week of the year,
            // takes a Date and returns the number of the week for it
            shortYearCutoff: "+10", // Short year values < this are in the current century,
            // > this are in the previous century,
            // string value starting with "+" for current year + value
            minDate: null, // The earliest selectable date, or null for no limit
            maxDate: null, // The latest selectable date, or null for no limit
            beforeShowDay: null, // Function that takes a date and returns an array with
            // [0] = true if selectable, false if not, [1] = custom CSS class name(s) or "",
            // [2] = cell title (optional), e.g. $.datepicker.noWeekends
            onSelect: function (text, object) {
                var self = this;
                setTimeout(function () {
                    if (!object.settings.inline) {
                        $(object.input)
                  .date("addMobileStyle");
                    } else {
                        $(object.settings.altField)
                  .date("addMobileStyle");
                    }
                }, 0);
            }, // Define a callback function when a date is selected
            onChangeMonthYear: function (month, year, object) {
                var self = this;
                setTimeout(function () {
                    if (!object.settings.inline) {
                        $(object.input)
                  .date("addMobileStyle");
                    } else {
                        $(object.settings.altField)
                  .date("addMobileStyle");
                    }
                }, 0);
            }, 
    }); 
})(jQuery);

DICKLI的主页 DICKLI | 初学一级 | 园豆:164
提问于:2014-03-21 10:38
< >
分享
所有回答(1)
0

说的清楚一点。

Eric.luo | 园豆:853 (小虾三级) | 2015-04-13 20:19
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册