1. Main configuration of Ext. Form. Field. Trigger
Configuration item |
Type |
Description |
Editable |
Boolean |
Whether to allow editing of text directly. If it is set to false, editing is not allowed. You can only set it through the trigger button. The default value is true. |
Hidetrigger |
Boolean |
Whether to hide the trigger button. The default value is false. |
Repeattriggerclick |
Boolean |
If the value is true, a click repeater is added to the trigger button. The default value is false. |
Readonly |
Boolean |
Whether the field is read-only. If it is true, the user is prevented from modifying the field content and hiding the trigger button. The default value is false. |
Repeattriggerclick |
Boolean |
If this parameter is set to true, a repeat operator is automatically added. |
Selectonfocus |
Boolean |
Whether to select the existing text in the input box immediately when getting the focus. The default value is false. This configuration takes effect only when editable is true. |
2. Ext. Form. Field. Trigger example
Code:
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" > < Html Xmlns = "Http://www.w3.org/1999/xhtml" > < Head Runat = "Server" > < Title > Ext. Form. Field. Trigger example </ Title > < Link Href = "Ext-4.0.7-gpl/resources/CSS/ext-all.css" REL = "Stylesheet" Type = "Text/CSS" /> < Script SRC = "Ext-4.0.7-gpl/Bootstrap. js" Type = "Text/JavaScript" > </ Script > < Script Type = "Text/JavaScript" > Ext. onready ( Function (){ VaR FRM = New Ext. Form. Panel ({Title: " Ext. Form. Field. Trigger example " , Bodystyle: " Padding: 5 " , Frame: True , Height: 100 , Width: 240 , Renderto: Ext. getbody (), defaults: {labelseparator: " : " , Labelwidth: 80 , Width: 230 , Labelalign: " Left " }, Items: [{xtype: " Triggerfield " , ID: " Memo " , Fieldlabel: " Trigger Field " , Hidetrigger: False , Ontriggerclick: Function (){ VaR Memo = FRM. getform (). findfield ( " Memo " ); Ext. MessageBox. Alert (memo. getvalue (); Ext. getcmp ( " Memo " ). Setvalue ( " Test " ) ;}}]}) ;}); </ Script > </ Head > < Body > </ Body > </ Html >
: