81,094
社区成员
发帖
与我相关
我的任务
分享
function selectYcl(obj){
$(document).ready(function(){
var type = 'type';
$('#'+obj.id+'').autocomplete("doYclmc",{
delay:200,
minChars: 0,
max: 15,
autoFill: false,
mustMatch: true,
matchContains: false,
scrollHeight: 220,
cacheLength:15,
extraParams: {},
formatItem: function(data, i, total) {
return data[0];
},
formatMatch: function(data, i, total) {
return data[0];
},
formatResult: function(data) {
return data[0];
}
});
});
}
function add()//增加到TBODY里
{
var tb=document.getElementById("tb");
rows=tb.rows.length;
if(i==0)i=rows-1;
i++;
tb.appendChild(addRow());
}
function addRow()//增加一行
{
var row=document.createElement("tr");
row.appendChild(addCell('txt','',''));
row.appendChild(addCell('checkbox','',''));
row.appendChild(addCell('text','ycl',false));
row.appendChild(addCell('text','cpgg',true));
row.appendChild(addCell('text','dw', true));
row.appendChild(addCell('text','ys',false));
row.appendChild(addCell('text','jcqdw',false));
row.appendChild(addCell('text','hw',false));
row.appendChild(addCell('text','dj',false));
row.appendChild(addCell('text','sl',false));
row.appendChild(addCell('text','jlsl',false));
row.appendChild(addCell('text','je',false));
return row;
}
//增加TEXT
function addText(id,IsRead)
{
var ip=document.createElement("input");
ip.style.width = '120%';
ip.style.height = '18px';
ip.style.border = '0';
ip.style.margin = '-2';
ip.style.padding = '3 3 0 3';
ip.style.fontFamily = 'tahoma';
ip.style.fontSize = '8pt';
ip.setAttribute("type","text");
ip.setAttribute("name",id+"_"+i);
ip.setAttribute("id",id+"_"+i);
ip.setAttribute("readOnly",IsRead);
if(id=='ycl')
{
ip.onclick=new Function("selectYcl(this);");//给动态增加的TEXT增加onclick方法
ip.onkeypress=new Function("CpbmEnter(this,event)");
}
if(id=='hw')
{
ip.onclick=new Function("selectHw(this);");
}
if(id=='ys')
{
ip.onclick=new Function("selectYs(this);");
}
if(id=='dj')
{
ip.onblur=new Function("countJe(this);");
}
if(id=='sl')
{
ip.onblur=new Function("countJe(this);");
}
if(id=='jcqdw')
{
ip.onblur=new Function("selectdw(this);");
}
return ip;
}
function selectYcl(obj){
$(document).ready(function(){
var type = 'type';
$('#'+obj.id+'').autocomplete("doYclmc",{
delay:200,
minChars: 0,
max: 20,
autoFill: false,
mustMatch: true,
matchContains: false,
scrollHeight: 220,
extraParams: {},
formatItem: function(data, i, total) {
return data[0];
},
formatMatch: function(data, i, total) {
return data[0];
},
formatResult: function(data) {
return data[0];
}
});
});
}