When using extjs for parameter settings, if you want to add the instruction sub after the text box, you still cannot find the proper one after a large circle on the website, after spending an afternoon at work, Xiaohua finally made this page and the functions I wanted. The page looks nice and natural, and I hope netizens will use extjs for projects.
The Code is as follows:
Var showForm;
Function panelShowForm ()
{
ShowForm = null;
ShowForm = new Ext. FormPanel ({
RenderTo: "showPanel ",
Region: 'north ',
Border: false,
BodyBorder: false,
Frame: true,
WaitMsgTarget: true,
LabelAlign: 'right ',
Id: "showForm ",
Items :[{
Layout: 'column ',
LabelWidth: 129,
Items :[
{
ColumnWidth:. 6,
Layout: 'form ',
Items :{
Name: "enable ",
HiddenName: "enable ",
FieldLabel: 'whether to enable password policy ',
Xtype: 'combo ',
Editable: false, // lazyRender: true is not allowed,
BlankText: 'The password must be enabled ', // The default value is null.
AllowBlank: false, // null is not allowed
Mode: 'local ',
TriggerAction: 'all ',
Store: new Ext. data. SimpleStore ({
Fields: ["value", "text"], data: [['1', 'Enable '], ['0', 'deactivated']
}),
// The two items must correspond to the fields
ValueField: "value ",
DisplayField: "text ",
Listeners: {change: function () {changeValue ();}
},
Anchor: '000000'
}
},{
ColumnWidth:. 4,
Layout: 'form ',
Items :{
HiddenName: "infoFillOne ",
Name: "infoFillOne ",
Xtype: 'label ',
Html: 'Disabled, the following items are unavailable ',
LabelSeparator :'',
Anchor: '000000'
}
},{
ColumnWidth:. 6,
Layout: 'form ',
Items: {hiddenName: "updateDay ",
Name: "updateDay ",
Xtype: 'textfield ',
FieldLabel: 'Update cycle ',
EmptyText: 'set to-1 This item is disabled ',
MaxLength: '20180101 ',
ReadOnly: false,
Vtype: 'day ',
Anchor: '000000'
}
},{
ColumnWidth:. 4,
Layout: 'form ',
Items :{
HiddenName: "info ",
Name: "info ",
Xtype: 'label ',
// LabelAlign: 'left ',
Html:
'If it is set to-1, this item is disabled ',
LabelSeparator :'',
Anchor: '000000'
}
}]
}]
})
}
/**
* Whether to enable password trigger events
*/
Function changeValue ()
{
If (queryForm. form. findField ('enabled'). getValue () = "0 ")
{
$ ("UpdateDay"). disabled = true;
} Else {
$ ("UpdateDay"). disabled = false;
}
}
/**
* Window display
*/
Function input ()
{
PanelShowForm ();
Win = new Ext. Window ({
Title: "adding plain text after extJs text box ",
Width: 200, // The initial width value of the window.
Hight: 200, // window initial hight Value
X: 100, // The initial x position of the window
Y: 100, // The initial position y of the window
Plain: true,
Modal: true, // mode window
Maximizable: true to maximize display
Resizable: false, // The window size cannot be dragged
Items: [showForm]
})
}