/source/gl/mb/form/checkboxgroupvalue.html
http://prosporous.googlecode.com/ · HTML · 191 lines · 185 code · 6 blank · 0 comment · 0 complexity · b7b3fed130dd6325f56d1a2e41a46f77 MD5 · raw file
- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>??????-checkboxgroup</title>
- <{$showjs}>
- <link rel="stylesheet" type="text/css" href="/Plug-in/ext/resources/css/xtheme-slate.css" />
- <link rel="stylesheet" type="text/css" href="/css/main.css" />
- <script language="javascript">
- Ext.override(Ext.form.Checkbox, {
- setBoxLabel: function(boxLabel,boxvalue){
- this.boxLabel = boxLabel;
- this.inputValue = boxvalue;
- if(this.rendered){
- this.wrap.child('.x-form-cb-label').update(boxLabel);
- }
- }
- });
- Ext.onReady(function(){
- var myMask = new Ext.LoadMask(Ext.getBody(), {
- msg: '???...',
- removeMask: true //?????
- });
-
- var tabpanel = new Ext.TabPanel({
-
- activeTab: 0,
- height:parent.Ext.get('t<{$fld.id}>').getHeight()-36,
- region : 'center',
- title : false,
- border : false,
- frame : true,
- defaults:{bodyStyle:'padding:10px'},
- items : [{
- title:'??',
- layout:'column',
- bbar:['->','-',{
- text: '??',
- handler:function(){
- myMask.show();
- var label_ = Ext.getCmp('label').getValue();
- var value_ = Ext.getCmp('value').getValue();
- var checkbox = new Ext.form.Checkbox({
- boxLabel: label_,
- name: 'checkbox',
- inputValue: value_,
- columnWidth:.25,
- listeners:{
- 'check':function(checkbox){
- if(checkbox.checked){
- var label = checkbox.boxLabel;
- var value = checkbox.inputValue;
- Ext.getCmp('label').setValue(label);
- Ext.getCmp('value').setValue(value);
- }
- }
- }
- });
- //var x = checkboxgroup;
- var checkboxgroup = Ext.getCmp('fieldset');
- checkboxgroup.items.add(checkbox);
- checkboxgroup.doLayout();
- myMask.hide();
- }
- },'-',{
- text: '??',
- handler:function(){
- myMask.show();
- var label_ = Ext.getCmp('label').getValue();
- var value_ = Ext.getCmp('value').getValue();
- if(label_!=null&&value_!=null){
- Ext.each(Ext.getCmp('fieldset').items.items,function(a,b,c){
- if(a.checked){
- a.setBoxLabel(label_,value_);
- }
- });
- }else{
- Ext.Msg.alert('??','???????');
- }
- myMask.hide();
- }
-
- },'-',{
- text: '??',
- handler:function(){
- Ext.MessageBox.confirm("????","???????????",function(_btn){
- if(_btn=="yes"){
- Ext.each(Ext.getCmp('fieldset').items.items,function(a,b,c){
- if(a.checked){
- this.destroy();
- this.disable();
- }
- });
- }
- });
- }
- },'-'],
- items:[{
- border:false,
- columnWidth:.5,
- height:100,
- autoHeight: true,
- layout:'column',
- bodyStyle:'padding:10px',
- items:[
- {
- xtype: 'label',
- text: '??',
- cls:'x-form-check-group-label',
- anchor:'-15'
- },{
- xtype: 'textfield',
- id:'label',
- name: 'label' }]
- },{
- border:false,
- columnWidth:.5,
- height:100,
- autoHeight: true,
- bodyStyle:'padding:10px',
- layout:'column',
- items:[{
- xtype: 'label',
- text: '?',
- cls:'x-form-check-group-label',
- anchor:'-15'
- },{
- xtype: 'textfield',
- id:'value',
- name: 'value'
- }]
- },{
- id:'fieldset',
- xtype:'fieldset',
- title:'??',
- columnWidth:1,
- height:100,
- autoHeight: true,
- bodyStyle:'padding:10px',
- layout:'column'
- <{$items}>
- }]
-
- }],
- buttons: [{
- text: '??',
- handler:function(){
- var x = '';
- Ext.each(Ext.getCmp('fieldset').items.items,function(a,b,c){
- if(!a.disabled){
- var check = '';
- if(a.checked){
- check = '#_#1';
- }else{
- check = '#_#0';
- }
- x = x + a.boxLabel+'#_#'+a.inputValue+check+'#=#';
- }
- });
- myMask.show();
- Ext.Ajax.request({
- waitMsg:'????....',
- method:'POST',
- params:{op:'save',type:'checkboxgroupvalue',param:x,id:'<{$fld.id}>'},
- url:'fldcfg.php',
- success:function(form, action) {
- myMask.hide();
- parent.Ext.getCmp('t<{$fld.id}>').close();
- },
- failure: function(form, action) {
- }
- });
- }
- },{
- text: '??'
- }]
- });
-
- var form = new Ext.form.FormPanel({
- renderTo: Ext.getBody(),
- items:[
- tabpanel
- ]
- });
-
- });
- </script>
- </head>
- <body>
- </body>
- </html>