真正好用的Easyui form表單設置只讀


function disableForm(formId) {  
    var formBean = $('#' + formId).form().context[formId];
    var formSize = formBean.length;
    for (var i = 0; i < formSize; i++) {
        if ('attributes' in formBean[i]) {
            if ('id' in formBean[i].attributes && 'class' in formBean[i].attributes) {
                var className = formBean[i].attributes.class.nodeValue;
                var id = formBean[i].attributes.id.nodeValue;
                if (className.indexOf("combobox") != -1) {
                    $('#' + id).combobox('readonly',true); 
                } else if (className.indexOf("datebox") != -1){
                    $('#' + id).datebox('readonly',true); 
                } else if (className.indexOf("textbox") != -1){
                    $('#' + id).textbox('readonly',true); 
                }
            }
        }
    }
}  

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM