ip属性共用值提取为一个全局的函数,当initCommIpVal执行的时候初始化ipcommon的属性,并且初始化完成之后将页面无用的select

option直接remove
This commit is contained in:
wangxin
2018-08-27 17:40:14 +08:00
parent 3350d70b8a
commit 531f85017d
2 changed files with 36 additions and 7 deletions

View File

@@ -67,10 +67,14 @@
}
//处理ICMP
if($(this).val()==32){
tabInfo.find("select[name$='protocol'] option[value='1']").removeAttr("disabled");
$.ipcommon.protocol.each(function(){
if($(this).attr("value")==1){
tabInfo.find("select[name$='protocol']").append($(this));
}
})
tabInfo.find("select[name$='protocol']").selectpicker("refresh");
}else{
tabInfo.find("select[name$='protocol'] option[value='1']").attr("disabled",true);
tabInfo.find("select[name$='protocol'] option[value='1']").remove();
tabInfo.find("select[name$='protocol']").selectpicker("refresh");
}