extjs 패널에서 동적 증가 items

1543 단어 Extjs
(mvc 모드에서의 구현)
{
							xtype : 'panel',
							height : 140,
							width : 500,
							id : 'dynamicFC',
							hidden : true,
							margin : '0px 0px 4px 0px',
							layout : {
								columns : 2,
								type : 'table',
								align : 'center'
							},
							items : [

							]
						}
function 중
OnChange : function(field, newValue, oldValue, eOpts) {
		
		// get fields container
		fc = Ext.getCmp('dynamicFC');
		fc.removeAll();// panel , -------1
		Ext.Ajax.request({
			url : '',// , items 
			params : {
				Id : newValue
			},
			method : 'Get',
			success : function(response, opts) {

				var success = Ext.decode(response.responseText).success;
				//  
				if (success) {
					var displayFieldsArray = Ext.decode(response.responseText).obj;
					for (i = 0; i < displayFieldsArray.length; i++) {
						displayFields = displayFieldsArray[i];
						displayFieldLabel = displayFields.displayFieldLabel;
						fieldName = displayFields.fieldName;
						displayFieldType = displayFields.displayFieldType;
						displayFieldValue = displayFields.displayFieldValue;
						//  items
						var items = {
							xtype : displayFieldType,
							name : fieldName,
							fieldLabel : displayFieldLabel
						}
						fc.add(items);// items panel , ----1 , , 
						fc.doLayout();
					}
				} else {

				}
			},
			failure : function(form, action) {
				Ext.Msg.alert(' ', action.result.message);
			}
		});
	},

좋은 웹페이지 즐겨찾기