//动态注册自动填充控件(训练场地)
function autoRegisterClassroom(obj,num){
//自动完成训练场地
var optionsClassroom = {
//最小匹配字数
minChars: 0,
//层显示条目数
max:10,
//层宽度
width: 400,
//包含匹配
matchContains: false,
//是否必须匹配
mustMatch: true,
//多选
multiple: false,
//自动填充
//autoFill: true,
/** 大数据量时使用方法 **/
extraParams: {
ajaxKeyWord:function(){return encodeURI(jQuery(obj).val())},classRoom_type:
function(){
return encodeURI(jQuery("input[name='classroomType']").val())
}
},
parse : function(data) {
return jQuery.map(eval(data), function(row) {
return {data : row, value : row.CLASSROOMID, result : row.CLASSROOMNAME}
});
},
formatItem: function(row, i, max){
return row.CLASSROOMNAME;
},
formatMatch: function(row, i, max){
//使用汉字或拼音(makePy)匹配
return row.CLASSROOMNAME + " " + makePy(row.CLASSROOMNAME);
},
formatResult: function(row){
return row.CLASSROOMNAME;
}
};
jQuery(obj).autocomplete("/jwcore/ajaxFindAllClassRoomAction.do?", optionsClassroom);
//选中条目时执行
jQuery(obj).result(function(event, data, formatted){
if(data == null){
document.getElementsByName("flxedClassroomID")[num].value = '';
}
if(data != null && data.CLASSROOMID != null && data.CLASSROOMID != ""){
document.getElementsByName("flxedClassroomID")[num].value = data.CLASSROOMID;
}
});
}
function autoRegisterClassroom(obj,num){
//自动完成训练场地
var optionsClassroom = {
//最小匹配字数
minChars: 0,
//层显示条目数
max:10,
//层宽度
width: 400,
//包含匹配
matchContains: false,
//是否必须匹配
mustMatch: true,
//多选
multiple: false,
//自动填充
//autoFill: true,
/** 大数据量时使用方法 **/
extraParams: {
ajaxKeyWord:function(){return encodeURI(jQuery(obj).val())},classRoom_type:
function(){
return encodeURI(jQuery("input[name='classroomType']").val())
}
},
parse : function(data) {
return jQuery.map(eval(data), function(row) {
return {data : row, value : row.CLASSROOMID, result : row.CLASSROOMNAME}
});
},
formatItem: function(row, i, max){
return row.CLASSROOMNAME;
},
formatMatch: function(row, i, max){
//使用汉字或拼音(makePy)匹配
return row.CLASSROOMNAME + " " + makePy(row.CLASSROOMNAME);
},
formatResult: function(row){
return row.CLASSROOMNAME;
}
};
jQuery(obj).autocomplete("/jwcore/ajaxFindAllClassRoomAction.do?", optionsClassroom);
//选中条目时执行
jQuery(obj).result(function(event, data, formatted){
if(data == null){
document.getElementsByName("flxedClassroomID")[num].value = '';
}
if(data != null && data.CLASSROOMID != null && data.CLASSROOMID != ""){
document.getElementsByName("flxedClassroomID")[num].value = data.CLASSROOMID;
}
});
}