Java 在Struts 2中为sj:datepicker使用beforeShow事件
如何将此选项设置为myJava 在Struts 2中为sj:datepicker使用beforeShow事件,java,struts2,jquery-ui-datepicker,struts2-jquery,Java,Struts2,Jquery Ui Datepicker,Struts2 Jquery,如何将此选项设置为mysj:datepickerdate picker $('input.date')。日期选择器({ 显示前:功能(输入、安装) { 警报(“输入前”); inst.dpDiv.css({marginTop:-input.offsetHeight+'px',marginLeft:input.offsetWidth+'px'}); } }); 我的看起来像这样: 编辑: 还是这个 beforeShow:function(i){if($(i).attr('readonl
sj:datepicker
date picker
$('input.date')。日期选择器({
显示前:功能(输入、安装)
{
警报(“输入前”);
inst.dpDiv.css({marginTop:-input.offsetHeight+'px',marginLeft:input.offsetWidth+'px'});
}
});
我的
看起来像这样:
编辑:
还是这个
beforeShow:function(i){if($(i).attr('readonly')){return false;}
在此线程上找到:将该代码更改为
<script type="text/javascript">
$.subscribe('beforeShow', function(event, data) {
alert("Before input");
var input = event.originalEvent.input;
var inst = event.originalEvent.inst;
inst.dpDiv.css({marginTop: -input.offsetHeight + 'px', marginLeft: input.offsetWidth + 'px'});
});
</script>
$.subscribe('beforeShow',函数(事件、数据){
警报(“输入前”);
var输入=event.originalEvent.input;
var inst=event.originalEvent.inst;
inst.dpDiv.css({marginTop:-input.offsetHeight+'px',marginLeft:input.offsetWidth+'px'});
});
和struts2 jquery小部件
<sj:datepicker
onBeforeTopics="beforeShow"
那么什么不起作用了?一切都起作用了我只想捕获打开日期选择器的事件。我如何停止执行事件?你想停止什么事件?打开日历的事件(日期面板)