/source/gl/mb/form/combo1value.html
http://prosporous.googlecode.com/ · HTML · 191 lines · 184 code · 7 blank · 0 comment · 0 complexity · 22c780632371eee718154c29f3422a45 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>??????-combo</title>
- <{$showjs}>
- <link rel="stylesheet" type="text/css" href="/css/main.css" />
- <script language="javascript">
- Ext.onReady(function(){
- var myMask = new Ext.LoadMask(Ext.getBody(), {
- msg: '???...',
- removeMask: true //?????
- });
- var store = new Ext.data.SimpleStore({
- fields:['name','value'],
- data:[<{$items}>]
- });
- var combobox = new Ext.form.ComboBox({
- id : 'combobox',
- name : 'combo',
- height: 150,
- width:200,
- fieldLabel : '????',
- hiddenName : 'combo',
- //data:store.data,
- value:'<{$ck}>',
- store:store,
- mode:'local',
- displayField:'name',
- valueField :'value',
- triggerAction:"all",
- listeners: {
- "select":{
- fn: function(_combo,store,index){
- _combo["selectItem"]=store;
- var label_ = store.data.name;
- var value_ = store.data.value;
- Ext.getCmp('label').setValue(label_);
- Ext.getCmp('value').setValue(value_);
- },
- scope: this
- }
- }
- });
-
- var form = new Ext.TabPanel({
-
- activeTab: 0,
- // height:parent.Ext.get('t<{$fld.id}>').getHeight()-36,
- 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 DATA=Ext.data.Record.create([{
- name:"name",value:"value"}
- ]);
- var label_ = Ext.getCmp('label').getValue();
- var value_ = Ext.getCmp('value').getValue();
- store.insert(0,new DATA({name:label_,value:value_}));
- combobox.setValue(label_);
- store["selectItem"]=store.getAt(0);
- myMask.hide();
- }
- }//,'-',{
- // text: '??',
- // handler:function(){
- // myMask.show();
- // var label_ = Ext.getCmp('label').getValue();
- // var value_ = Ext.getCmp('value').getValue();
- // if(combobox["selectItem"]!=null){
- // combobox["selectItem"].set("value",value_);
- // combobox.setValue(label_);
- // }else{
- // Ext.Msg.alert('??','???????');
- // }
- // myMask.hide();
- // }
- // }
- ,'-',{
- text: '??',
- handler:function(){
- if(combobox["selectItem"]!=null)
- Ext.MessageBox.confirm("????","???????????",function(_btn){
- if(_btn=="yes"){
- try{store.remove(combobox["selectItem"]);}catch(_err){}
- if(store.getCount()){
- combobox.setValue(store.getAt(0).get("value"));
- combobox["selectItem"]=store.getAt(0);
- }else{
- combobox.setValue('');
- combobox["selectItem"]=null;
- }
- }
- });
- }
-
- },'-'],
- items:[{
- border:false,
- columnWidth:.5,
- 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',value:'<{$xv}>'
- }]
- },{
- border:false,
- columnWidth:.5,
- 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',value:'<{$ck}>' }]
- },{
- xtype:'fieldset',
- title:'??',
- columnWidth:1,
- autoHeight: true,
- bodyStyle:'padding:10px',
- layout:'form',
- items:[combobox]
- }]
-
- }],
- buttons: [{
- text: '??',
- handler:function(){
- var x = '';
- Ext.each(combobox.store.data.items,function(a,b,c){
-
- x = x + a.data.name+'#_#'+a.data.value+ '#=#';
- });
- myMask.show();
- Ext.Ajax.request({
- waitMsg:'????....',
- method:'POST',
- params:{op:'save',type:'combovalue',param:x,id:'<{$fld.id}>',ck:Ext.getCmp('combobox').getValue()},
- url:'fldcfg.php',
- success:function(form, action) {
- myMask.hide();
- parent.Ext.getCmp('t<{$fld.id}>').close();
- },
- failure: function(form, action) {
- }
- });
- }
- },{
- text: '??'
- }]
-
-
- });
- var tabpanel = new Ext.form.FormPanel({
- renderTo: Ext.getBody(),
- //frame:true,
- //defaults:{autoScroll: true},
- items:[
- form
- ]
- });
- });
- </script>
- </head>
- <body>
- </body>
- </html>