想要设置表单上所有input为禁用,该如何做?
$(this).textbox('disable', true);
$(this).textbox('readonly');
$(":input").each(function () {
var tt = this.name;
if (tt == "textbox") {
//alert($(this).id());
$(this).textbox('setValue', '1');
$(this).textbox('disable', true);
}
})
$(':input').each(function(){//获取所有输入框遍历
try{//放入try..catch中,放置不是easyui控件报错
$(this).textbox('disable')//禁用
//$(this).textbox('readonly')//只读
}catch(e){}
})
遍历.textbox(easy ui 自动添加的class可能是这个),然后禁用即可。
$(this).textbox('readonly');//只读
$(this).textbox('disable');//不可编辑
遍历里上面那样就可以了