ExtJs Tree 작업

4334 단어 extjs TreeEdit
{
	                             text: "${uiLabelMap.editNode}",
	                             //icon: "list.gif",
	                             handler:function(){
	                             	Ext.Ajax.request({
								    	url: '/customize/control/getModuleWithJson',
								        method:'post',
								        params:{moduleId:node.id},
								        success: function(response, option) {
								        	var result = response.responseText;
								            window.alert(result);
								            if(result=='error'){
								            	Ext.Msg.alert("${uiLabelMap.operationResult}", '<font color=blue> ${uiLabelMap.failedOperation} </font>');		
								            }else{
								                var tempArray=result.split(",");
								                form1.form.reset();
								                if(tempArray[0]!=null){
								                	Ext.getCmp('nodename').setValue(tempArray[0]);
								                }
								                if(tempArray[1]!=null){
								                    Ext.getCmp('Code').setValue(tempArray[1]);
								                }
								                if(tempArray[2]!=null){
								                	if(tempArray[2]=='true'){
								                    	Ext.getCmp('operaion').checked=true; 
								                    }else if(tempArray[2]=='false'){
								                        Ext.getCmp('manager').checked=true; 
								                    }else{
								                        Ext.getCmp('operaion').checked=true; 
								                    }
								                }
							                    editedNodes(node);
								            }
								        },
								        failure: function(response, option) {
								        	Ext.Msg.alert('${uiLabelMap.editDepartmentError}',"${uiLabelMap.contactTheAdministrator}");
								        }
			                        });
	                             }
	                         }

 
function editedNodes(node){
		var win2 = new Ext.Window({
		title:"${uiLabelMap.window}",
      	renderTo:'window-win',
      	layout:'form',
      	width:315,
      	closeAction:'hide',
      	items: [form1],
      	modal: true,
      	buttons:[{
      		text:'Update',
			disabled:false,
			handler: function(){
				var nodeaname = Ext.getCmp('nodename').getValue();
            	var codeval = Ext.getCmp('Code').getValue();
            	var isOvy = form1.form.findField("isOverlay").getValue();
				Ext.Ajax.request({
					url: '/customize/control/editModuleWithJson',
					method:'post',
					params:{moduleId:node.id,nodename:nodeaname,code:codeval,isOverlay:isOvy},
					success: function(response, option) {
						var result = response.responseText;
						if(result=='error'){
                            Ext.Msg.alert("${uiLabelMap.operationResult}", '<font color=blue> ${uiLabelMap.failedOperation} </font>');		
                        }else{
							Ext.Msg.alert("${uiLabelMap.operationResult}", '<font color=blue> ${uiLabelMap.DataUpdateSuccess} </font>');                        	
                        	win2.hide();
                        }
					},
					failure: function(response, option) {
                    	form1.form.reset();
	                    win2.hide();
                        Ext.Msg.alert('${uiLabelMap.editDepartmentError}',"${uiLabelMap.contactTheAdministrator}");
                    }
				});
			}
	      },{
	      		text: 'Close',
            	handler: function(){
            	form1.form.reset();
                win2.hide();
            }
      	}]
	});
	win2.show();
	}

좋은 웹페이지 즐겨찾기