小编Mic*_*ker的帖子

为什么jQuery UI datepicker不能在jQuery对话框模式中工作?

我想在我的一个文本输入中使用jQuery UI datepicker.这个是一个对话模式.

事实上,我可以在正常的文档文本输入中调用datepicker,并且我正常地得到了我的日历,但我不能在对话模式文本输入中做到这一点(在模态文本输入内部克隆之后我没有任何JavaScript错误).

这是我调用datepicker的代码:

$(function() {
    $("#MytextInputID").datepicker({ dateFormat: 'dd/mm/yy' });
);
Run Code Online (Sandbox Code Playgroud)

我试过更改css .ui-datepicker Z-index属性,但我什么都没有.

你有解决这个问题的技巧吗?

问候,


在my_page.html我有

function openSaisieARModal()
        {
            window_select_CodeAgence = new showModalWindow('SaisieARModal', 500);
        }

我使用这个脚本

var showModalWindow=function(id, width)
{
    var newId=id+'Copy';
    this.id=newId;

var previousNode=document.getElementById(newId);
if(previousNode!=null)
{
    previousNode.parentNode.removeChild(previousNode);
}

var rootNode=document.getElementsByTagName('body')[0];
this.node=document.createElement("div");
rootNode.appendChild(this.node);
this.node.setAttribute('id', newId);
this.node.setAttribute('title', document.getElementById(id).getAttribute('title'));
this.node.innerHTML=document.getElementById(id).innerHTML;
if(width==null)
{
    width=400;
}
$('#'+newId).dialog({autoOpen: true, modal: true, width:width });

this.closeWindow=function()
{
    $('#'+this.id).dialog('close');
}

this.centerContent=function()
{
    this.node.style.textAlign='center';
}

this.center=function()
{
    $('#'+this.id).dialog('option', 'position', 'center');
}
Run Code Online (Sandbox Code Playgroud)

}

这是my_page.html中的模态HTML代码

<div style="display:none;">
        <div id="SaisieARModal" …
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)

jquery datepicker uidatepicker jquery-ui-datepicker

14
推荐指数
3
解决办法
4万
查看次数

我们什么时候使用ruby模块和使用类组合?

之前已经提出过与此类似的问题,但我特别要求使用组合作为使用模块mixins的替代方法.

class Helper
  def do_somthing
  end
end
Run Code Online (Sandbox Code Playgroud)

如果我需要"使用"一个类而不是继承它,我只需要编写并使用它.

class MyStuff
  def initialize
    helper = Helper.new
    helper.do_something
  end
end
Run Code Online (Sandbox Code Playgroud)

为什么我要为此创建一个模块:

 module Helper
   def do_something
   end
 end

class MyStuff
  include Helper
end
Run Code Online (Sandbox Code Playgroud)

我看到的唯一区别是,Helper如果我使用模块,周围不会有很多物体.但是我没有看到任何东西,周围有更多物体,而不是更大的物体.

而且,我不知道将来是否需要将其子类化.那么我该如何判断我的库的用户是想要使用模块mixin,还是想要使用合成?

ruby inheritance multiple-inheritance composition mixins

9
推荐指数
1
解决办法
4600
查看次数

我如何期望一个消息,其参数是RSpec中任何类的实例?

如何编写期望使用类的任何实例调用的消息期望?我想做这样的事情:

@controller.should_receive(:sign_in_and_redirect).with(kind_of? User)
Run Code Online (Sandbox Code Playgroud)

ruby rspec ruby-on-rails

2
推荐指数
1
解决办法
1513
查看次数