(function($){
$.fn.doselectmore = function(settings) {
var dfop ={
namekey: "이름",
pnamekey: "이름" ,
idkey: "id",
selectname:"sel",
메서드: "POST",
데이터 유형: "json",
param:{},
pval: null,
chckval:null,
chckvalarry:null,
pname:false,
nname:false,
vl:0,
url: false,
data: false
};
$.extend(dfop, 설정);
//alert(eobj(dfop))
var me = $(this)
if(!dfop.nname) ){
dfop.nname = (dfop.selectname (dfop.vl 1))
}
if((!dfop.pname)&&dfop.vl>0){
dfop.pname = dfop.selectname (dfop.vl-1);
}
if(!dfop.data){
if (dfop.url) {
var param =
$. ajax({
유형: dfop.method,
url: dfop.url,
데이터: dfop.param,
dataType: dfop.datatype,
성공: 함수(데이터){
dfop.data=data;
selectmorebuilder(me,dfop);
},
error:(function(request,status,err){
var errText = request.responseText;
var ErrMessage = "화면 출력" request.status "화면 출력",
";
ErrMessage = "错误内容为:" request.statusText "n" errText.substring(errText.indexOf("
") 5,errText.indexOf("
"));
alert(ErrMessage);
})
});
}
}else{
selectmorebuilder(me,dfop)
}
function selectmorebuilder(thisme ,df) {
if(df.chckval!=null&&df.chckvalarry==null){
var pid=df.chckval;
var k=1;
df.chckvalarry = new Array( );
df.chckvalarry.push(pid);
while(k>0){
k=0
$.each(df.data, function(i, item) 🎜>if(item[df.idkey]==pid&&item[df.pnamekey]!=df.pval){
pid=item[df.pnamekey]
df.chckvalarry.unshift(pid); 🎜>k ;
}
});
}
}
// Alert(eobj(df.chckvalarry))
var select = $("