注意:千万不要少 lay-search
<div class="layui-col-md4">
<label class="layui-form-label"><em>*</em>始发地:</label>
<div class="layui-input-block layui-form" lay-filter="OD_START_LAND">
<select name="OD_START_LAND" id="OD_START_LAND" lay-filter="OD_START_LAND" lay-verify="required" lay-search>
<option value="">请输入</option>
</select>
</div>
</div>
selectLike({
id: "OD_START_LAND",
url: "/Basic/GetAreaDrop",
paramKey: "name",
currValue: startValue,//当前值,用于编辑时赋值或赋默认值
pageSize: 30, //最大检索行数默认为10行
option: {
keyField: "ID",
textField: "FULL_CNAME"
},
//keyCode: [32],
timer: 500 //输入完成后自动触发检索的时间间隔(毫秒)
});
function selectLike(obj) {
var lastTimer = 0;
//参数
var oldValue = "";
var pramas = {
pageSize: obj.pageSize || 10 };
//值为空时
if (typeof obj.currValue === "undefined" || obj.currValue === null || obj.currValue === "") {
pramas[obj.paramKey] = oldValue;
form.render("select", obj.id);
//$("#" + obj.id).next().find("input"