$(function() { var thisview; $("a[rel=myconfig]").live("click", function() { thisview = $(this).parents(".box-element").find(".view").children(); var conf = $(this).next().children(); var id=Math.random(); $(this).parents(".box-element").attr("sid",id); //myconsole.log(conf.html()); $("#myconfigModal .modal-body").empty(); $("#myconfigModal .modal-body").append(conf.clone()); $("#myconfigModal").attr("sid",id); $("#myconfigModal").modal(); $(".modal-body .colorpicker").colorpicker(); }); //修改背景色 $("button[rel=myconfig1]").live("click", function() { thisview = $(".container"); var conf = $(this).next().children(); var id=Math.random(); //$(this).parents(".container").attr("sid",id); //myconsole.log(conf.html()); $("#myconfigModal .modal-body").empty(); $("#myconfigModal .modal-body").append(conf.clone()); $("#myconfigModal").attr("sid",id); $("#myconfigModal").modal(); $(".modal-body .colorpicker").colorpicker(); }); $(".prop").live("change", function() { var tag=$(this).get(0).tagName; if(tag=="SELECT"){ var r = ""; $(this).find("option").each(function() { r += $(this).val() + " " }); thisview.removeClass(r); thisview.addClass($(this).val()); }else if(tag=="INPUT"){ var val=$(this).val(); var ref=$(this).attr("ref"); thisview.css(ref,val+"px"); } }); $(".bindColumn").live("change", function() { var _conf=$(this); var columnID=$(this).val(); var sid=_conf.closest("#myconfigModal").attr("sid"); var _thisWidget=$(this).closest("body").find("[sid='"+sid+"']"); _thisWidget.find(".getTitlePic").attr("th\:each","info:\${\#fsmtag.getTitlePic('"+columnID+"',7)}"); _thisWidget.find(".getColumnByID").attr("th\:with","column=\$\{\#fsmtag.getColumnByID('"+columnID+"')}"); }); })