eval实例

....
    var sel_MedicineType = 'sel_MedicineType' + lastIndex;
    eval(sel_MedicineType + "= new C_Select('" + sel_MedicineType + "')");
    eval(sel_MedicineType + ".BindingData(JSON.parse('" + JSON.stringify(MedicineTypeList) + "'))");
    //$("input[type='text'].MedicineID").focus();//为了定位最后1行
    eval(sel_MedicineType + ".Change = function () { ChangHerbQty(" + lastIndex + ",this)}")
    eval("$(\"button[data-id='" + sel_MedicineType + "']\").click()");
}
//项目类型控制"贴数字段"
function ChangHerbQty(index, selObj) {
    if (selObj.value == "ClcA600003") {
        $("#PostsQuantity" + index).attr("disabled", true); //PostsQuantity 贴数字段
    }
    else {
        $("#PostsQuantity" + index).attr("disabled", false);
    }
}

 

posted @ 2017-09-21 16:14  轴轴  阅读(251)  评论(0编辑  收藏  举报