在我的php文件中,我想使用jQuery Datepicker.
加载我的文件时,我创建了禁用的Datepicker.
然后,当我的php文件(它是一个表单)中的特殊字段被填充时,我想启用Datepicker.
所以,最初我的Datepicker看起来像这样:
$("#from").datepicker({
showOn: "both",
buttonImage: "calendar.gif",
buttonImageOnly: true,
buttonText: "Kalender",
showAnim: "drop",
dateFormat: "dd.mm.yy",
changeMonth: true,
changeYear: true,
showButtonPanel: true,
showWeek: true,
firstDay: 1,
dayNamesMin: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
weekHeader: "KW",
disabled: true,
onClose: function(selectedDate) {
$("#to").datepicker("option", "minDate", selectedDate);
}
});
Run Code Online (Sandbox Code Playgroud)
这工作得很好,到目前为止没问题.当我想要禁用该字段时,问题就来了.
如果填写了一个特殊字段,我会打电话 $("#from").datepicker('enable');
这也很好,但现在我想再次禁用它,如果我提到的特殊字段再次为空.
然后我使用$("#from").datepicker('disable');并且字段本身是灰色的,但我仍然可以使用该字段输入值,日历弹出,甚至框旁边的日历图像也是可点击的.
任何人都知道为什么会这样?我错过了什么吗?
我有一个我使用的ant的build.xml
<exec executable="cmd">
<arg line = "start"/>
<arg value ="/c test3.bat"/>
</exec>
Run Code Online (Sandbox Code Playgroud)
启动给定的bat文件.这工作正常,但我真正想要的是它在一个新的cmd窗口中打开test3.bat.是否有可能实现这一目标?
我正在使用PHPMD(http://phpmd.org/),我对此很新.MD工作,我现在正在编写一个规则集来配置应该使用的指标.我没有单独包含每个规则,而是加载整个规则集.但是现在我遇到的问题是,如果我包含整个集合,我不知道如何配置单个规则的属性.
例如,我想使用该规则来检查圈复杂度.我可以用
<?xml version="1.0"?>
<ruleset name="Demo PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description> custom ruleset that checks the code </description>
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
<properties>
<property name="reportLevel" value="11" />
</properties>
</rule>
</ruleset>
Run Code Online (Sandbox Code Playgroud)
但是,如果我想使用该规则集中的所有规则,我可以简单地写
<?xml version="1.0"?>
<ruleset name="Demo PHPMD rule set"
xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description> custom ruleset that checks the code </description>
<rule ref="rulesets/codesize.xml" />
</ruleset>
Run Code Online (Sandbox Code Playgroud)
现在,当我包含整个规则集时,如何使用属性的配置(在我的情况下,reportLevel用于圈复杂度)?我试过类似的东西
[...]
<rule ref="rulesets/codesize.xml">
<properties>
<property name="CyclomaticComplexity.reportLevel" value="11" />
</properties>
</rule>
[...]
Run Code Online (Sandbox Code Playgroud)
但那没用.我搜索了文档,但从未在任何地方找到过这样的例子.