代码:
handler: function (event, inst) {
alert('Custom button clicked!');
that.mobiscroll('setValue', ['0', '0', '0', '0']);
}
},
代码的上述部分不适用于日期选择器。对于[01]-[aug]-[2015]格式,预期结果显示为[00]-[000]-[0000]
在MOBISCROLL DATE(.mobiscroll()。date(.....))
完整代码:
$('#demo_date').mobiscroll().date({
theme: theme, // Specify theme like: theme: 'ios' or omit setting to use default
mode: mode, // Specify scroller mode like: mode: 'mixed' or omit setting to use default
display: display, // Specify display mode like: display: 'bottom' or omit setting to use default
lang: lang, // Specify language like: lang: 'pl' or omit setting to use default
headerText:'onset date picker',
showLabel:true,
dateFormat:'dd/M/yy',
dateOrder:'ddMyy',
dayText:'Day',
monthText:'Month',
yearText:'year',
buttons: [
{
text: 'reset',
cssClass: 'dwb2 dwb-e dwb',
/*handler:'clear',*/
handler: function (event, inst) {
alert('Custom button clicked!');
that.mobiscroll('setValue', ['0', '0', '0', '0']);
}
},
{
text: 'cancel',
handler: 'cancel',
cssClass: 'dwb2 dwb-e dwb'
} ,
{
text:'ok',
handler:'set',
cssClass:'dwb2 dwb-e dwb'
}
]
});
我提到完整的代码部分,部分代码不起作用
最佳答案
$(this).mobiscroll('setValue', ['0', '0', '0', '0']);