var valChanged=false;
var selectRow=null;
//q_Item加载项目
function fillqItemCombogrid(qitemobj,unit,year,itemname)
{
qitemobj.combogrid({
onChange: function (newValue, oldValue) {
valChanged = true;//记录是否有改变(当手动输入时发生)
},
onHidePanel: function () {
var t = $(this).combogrid(‘getValue‘);
if (valChanged) {
if (selectRow == null || t != selectRow.id) {//没有选择或者选项不相等时清除内容
if(!(typeof(t) == "undefined")&&t!="")
{
$.messager.alert(‘提示‘,‘请选择,不要直接输入‘);
}
$(this).combogrid(‘setValue‘, ‘‘);
} else {
//do something...
}
}
valChanged = false;
selectRow = null;
},
onSelect: function (index, row) {
selectRow = row;
},