<?xml version="1.0" encoding="UTF-8"?> <a:screen xmlns:a="http://www.leaf-framework.org/application"> <a:view> <script type="text/javascript"><![CDATA[ function customization_cancel(){ $('sys_customization_window').close(); } function customization_ok(){ var ds = $('customization_ds'); var r = ds.getCurrentRecord(); var v = r.get('switch'); var ifa = document.getElementById('mainFrame'); var wid = ifa.contentWindow; if(v=='Y'){ wid.Leaf.startCustomization(); }else{ wid.Leaf.stopCustomization(); } customization_cancel(); } function customizationRenderer(v){ if(v == 'Y'){ return '<span style="color:green">开启</span>' }else{ return '<span style="color:red">关闭</span>' } } function customizationSwitch(){ var ds = $('customization_ds'); var r = ds.getCurrentRecord(); var s = r.get('switch'); if(s=='Y'){ r.set('switch','N') Ext.get('custStopBtn').setStyle('display','none'); Ext.get('custStartBtn').setStyle('display',''); }else{ r.set('switch','Y') Ext.get('custStopBtn').setStyle('display',''); Ext.get('custStartBtn').setStyle('display','none'); } } ]]></script> <a:dataSets> <a:dataSet id="customization_ds"/> </a:dataSets> <center> <TABLE border="0" cellSpacing="10" cellPadding="0" style="margin-top:50px;"> <TR> <TD style="font-size:16px;">个性化设置状态:</TD> <TD><a:label bindTarget="customization_ds" renderer="customizationRenderer" width="60" name="switch" style="font-size:16px;text-align:left"/></TD> <TD> <a:button text="开启" style="display:none" width="80" btnstyle="font-size:16px;color:green" height="30" id="custStartBtn" click="customizationSwitch"/> <a:button text="关闭" style="display:none" width="80" btnstyle="font-size:16px;color:red" height="30" id="custStopBtn" click="customizationSwitch"/> </TD> </TR> </TABLE> </center> <div class="win-toolbar" style="width:100%;height:38px;position:absolute; bottom:0px;"> <a:hBox style="float:right;margin-right:10px;margin-top:5px;"> <a:button click="customization_ok" text="HAP_OK" width="90"/> <a:button click="customization_cancel" text="HAP_CANCEL" width="90"/> </a:hBox> </div> <script type="text/javascript"><![CDATA[ function initCustomization(){ var ds = $('customization_ds'); var ifa = document.getElementById('mainFrame'); var wid = ifa.contentWindow; var v = 'N' var ct = wid.Leaf.CmpManager.get('_customization'); if(ct) v = 'Y'; ds.create({'switch':v}); if(ct!=null) { Ext.get('custStopBtn').setStyle('display', ''); }else{ Ext.get('custStartBtn').setStyle('display', ''); } } initCustomization(); ]]></script> </a:view> </a:screen>