하나 개의 솔루션은 구성 요소로 추가 사업부를 만들 메인 필드가 "fieldcontainer"에 배치하는 것입니다.
listeners: {
afterrender: function (cmp) {
// Get the Window Container
var container = this.body.dom.id;
// Get the Component (ExtJS way)
var comp = Ext.getCmp("displayColumn");
// The ExtJS field ID is not the same you gave
var el = comp.getEl();
// Get the real Field ID
var displayColumnId = el.id;
// If you need its value...
var initialColor = comp.getValue();
// If you need to hide the field to make room to your div...
// I mean if you want to replace the field and keep the label...
// <YOUR_FIELD_ID>-triggerWrap
$("#displayColumn-triggerWrap").css("display","none");
// Append your div to the field container
// <YOUR_FIELD_ID>-bodyEl
$("#displayColumn-bodyEl").append(YOUR_DIV);
}
}
는 사업부와 같은 몇 가지 스타일을 수행 여기
{
xtype: 'fieldcontainer',
layout: 'hbox',
items: [{
xtype: 'textfield',
fieldLabel: 'Picture'
},{
xtype: 'component',
autoEl: 'div',
width: 32,
height: 32,
margin: '0 0 0 5',
style: 'border: 1px solid #d0d0d0; border-radius: 50%'
}]
}
이 양식 리스너입니다
fieldLabel: 'My Field',
width: 330,
id: 'displayColumn',
name: 'displayColumn',
allowBlank : false,
value : '#CACACA',
양식 필드이 개념
좋아요! 너 규칙! ID를 줄 수 있습니까? 내 솔루션보다 더 우아함 –
완료. 완벽하게 일했습니다. –
필드 정렬에 약간 문제가 있습니다. 내 질문에 넣어 이미지를 참조하십시오. –