网格输入码(直接获取文本框)

//网格输入码,后台 ,利用控件
$(document).ready(function () {
var khid = 3026;
$("td [colname='PH']").children("input[type='text']").autocomplete("ZJM2.ashx", {
width: 150,
max: 20,
delay: 5,
mustMatch:true,
cacheLength: 1,
extraParams: {a: function() {return khid;}},
formatItem: function(data, i, max) {
return data.toString().split(",")[1]+ " "+data.toString().split(",")[3]+" "+ data.toString().split(",")[2];
},
formatResult: function(data) {
return data.toString().split(",")[1];
}
}).result(function(event, data, formatted) {
// ID||','||PH||','||DJ||','||PM||','||GGXH||','||JLDWMC||','||BDJ
$(this).parent().siblings("td[colname='DJ']").children("input[type='text']").val(data.toString().split(",")[2]);
$(this).parent().siblings("td[colname='PM']").text(data.toString().split(",")[3]);
$(this).parent().siblings("td[colname='GGXH']").text(data.toString().split(",")[4]);
$(this).parent().siblings("td[colname='JLDWID']").text(data.toString().split(",")[5]);
$(this).parent().siblings("td[colname='BDJ']").text(data.toString().split(",")[6]);
});
});

posted @ 2015-07-12 10:19  大虎1  阅读(219)  评论(0编辑  收藏  举报