The extJs text box is followed by the description text + the selected value in the drop-down list to trigger the Event _ extjs

Source: Internet
Author: User
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]
})
}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.