页面代码:
<div role="row">
<div role="control" label="姓名">
<input id="search_name" class="mini-textbox" emptyText="请输入姓名" bind="dataBean.name" />
</div>
<div role="control" label="性别">
<input class="mini-radiobuttonlist" bind="dataBean.sex" id="search_sex" data="[{text:‘男‘,id:‘男‘},{text:‘女‘,id:‘女‘}]" textField="text" valueField="id" required="true" />
</div>
</div>
<div role="row">
<div role="control" label="入党时间">
<input name="riqione" id="riqione" bind="riqione" class="mini-datepicker" ondrawdate="onRegistdateFromDr" style="width: 44%;" format="yyyy-MM-dd" data-options="{‘format‘: ‘yyyy-MM-dd‘}" showTime="false" showClearButton="true" /> <span style="width: 12%; text-align: center">至</span> <input name="riqitwo" id="riqitwo" class="mini-datepicker" ondrawdate="onRegistdateToDr" style="width: 44%;" bind="riqitwo" data-options="{‘format‘: ‘yyyy-MM-dd‘}" showTime="false" showClearButton="true" /> <br />
</div>
日期控件验证:
function onRegistdateFromDr(e) {
var date = e.date;
var to = mini.get("riqitwo").getValue();
if (to) {
if (date.getTime() > to.getTime()) /////-24*60*60*1000表示可以包含当天
{
e.allowSelect = false;
}
}
}
function onRegistdateToDr(e) {
var date = e.date;
var from = mini.get("riqione").getValue();
if (from) {
if (date.getTime() < from.getTime()) /////-24*60*60*1000表示可以包含当天
{
e.allowSelect = false;
}
}
}
下拉框 带关闭按钮
<div role="row">
<div role="control" label="资产类别">
<input id="search_goodstype" class="mini-combobox" bind="dataBean.goodstype" action="getGoodsTypeModel" showClose="true" onCloseclick="clearchoose"/>
</div>
</div>
//清除下拉框搜索关键字
function clearchoose(e){
var obj = e.sender;
obj.setText("");
obj.setValue("");
}
List<SelectItem> goodsTypeModel = null;
public List<SelectItem> getGoodsTypeModel() {
if (goodsTypeModel == null) {
goodsTypeModel = DataUtil.convertMap2ComboBox(
(List<Map<String, String>>) CodeModalFactory.factory("下拉列表", "资产类别", null, false));
}
return goodsTypeModel;
}
原文地址:https://www.cnblogs.com/yaozz/p/10361827.html