标签:
1.$("#i_limit_chk").off(‘ifChecked ifUnchecked‘).on(‘ifChecked ifUnchecked‘, function(event) {
if(event.type == ‘ifChecked‘){
$("#vc_classroom").attr("disabled",false);
$("#vc_islimit").val(1);
var url="${def:context}${def:actionroot}/getclassroom";
ajaxCall(url,{
method:"GET",
dataType:"script",
progress:true,
success:function(){
ccms.util.setComboValue(‘vc_classroom‘,$("#classroom").val(),"formEditor");
}
});
}else{
$("#vc_classroom").attr("disabled",true);
$("#vc_islimit").val(0);
var url="${def:context}${def:actionroot}/getclassroom?vc_code=jsuw";
ajaxCall(url,{
method:"GET",
dataType:"script",
progress:true,
success:function(){
ccms.util.setComboValue(‘vc_classroom‘,$("#classroom").val(),"formEditor");
}
});
}
2.//是否需要预约,需要则填写时间
$("#i_isprepaer_chk").on(‘ifChecked ifUnchecked‘, function(event) {
if(event.type == ‘ifChecked‘){
$("#f_allowbeginbook").removeAttr("readonly");
$("#f_allowbook").removeAttr("readonly");
$("#f_allowcancel").removeAttr("readonly");
$("#i_isprepaer").val(1);
}else{
$("#f_allowbeginbook").val("");
$("#f_allowbook").val("");
$("#f_allowcancel").val("");
$("#f_allowbeginbook").attr("readonly","");
$("#f_allowbook").attr("readonly","");
$("#f_allowcancel").attr("readonly","");
$("#i_isprepaer").val(0);
}
});
3.//是否课时收费
$("#i_isfee_chk").on(‘ifChecked ifUnchecked‘, function(event) {
if(event.type == ‘ifChecked‘){
$("#f_classfee").removeAttr("readonly");
$("#i_isfee").val(1);
}else{
$("#f_classfee").val("");
$("#f_classfee").attr("readonly","");
$("#i_isfee").val(0);
}
});
$("input[name=‘i_status‘]:eq(0)").iCheck("check");
$(".btn_status").each(function(){
//给类名是btn_status的按钮(因为有很多这样按钮)绑定修改方法
$(this).click(function(){
// sa是把状态由汉字转化成数字
var s=$(this),sa=-1;
if(s.text()=="已禁用"){
sa=1;
}else if(s.text()=="已启用"){
sa=0;
}else{
return;
}
var url="${def:context}${def:actionroot}/changestatus?code="+$(this).attr("code")+"&status="+sa;
ajaxCall(url,{
method:"GET",
progress:true,
dataType:"script",
success:function(){
s.text(sa==0?"已禁用":"已启用")
}
});
});
});
标签:
原文地址:http://www.cnblogs.com/prefect/p/5698873.html