Related properties of ExtJS

Source: Internet
Author: User

Common Properties:
    Labelseparator: '//indicates fieldlabel does not show colon after ":"    readonly:true//only read    focuscls: ' txthalfinput '/style    with focus Maxlength:3, enforcemaxlength:true//number of input digits check    fieldstyle: ' margin-top:3px; ' Display up and down incorrect alignment resolution method

Ext.button.Button

Property:

enabletoggle:true//Set button to switch state pressed:true//switch not pressed status disabled:true//make button unavailable, false available

Method:

var pressed = ext.getcmp (' Buttonguard '). Whether pressed;//is a pressed state

Ext.form.field.Text

Property:

    Fieldstyle: ' ime-mode:disabled ',//Set Text style    fieldcls: ' Txthalfinput ',//Set text class

Method:

        Focus (true,600);//Set focus, True table selection, False table only set focus; 600 table page loading completed 0.6 seconds after operation

Ext.form.field.ComboBox

Property:

    Valuefield: ' ID '  //' key value    Displayfield: ' NAME '//' drop-down ' content    Editable:false//false cannot be manually changed, true can be manually changed    Validator:function (v) {//table item itself defines check           return ' unvalidator ';//returns TRUE for legal, otherwise form error message    }


Method:

get/setrawvalue//Gets or sets the combo selected value


Ext.form.NumberField

Property:

hidetrigger:true,//does not show the control to the right of the upper and lower arrows//implement focus once left. 1.00 directly into 1ext.form.gnumberfield = Ext.extend (Ext.form.NumberField, {setvalue:function (v) {v = typeof v = = ' numb Er '?

V:string (v). Replace (This.decimalseparator, "."); v = IsNaN (v)?

': String (v). Replace (".", This.decimalseparator); This.replacedecimalval (v); If you want to ensure, the values being set on the field are also forced to the required number of decimal places. (not extensively tested) v = IsNaN (v)? ': This.fixprecision (String (v). Replace (".", This.decimalseparator)); var ret = Ext.form.NumberField.superclass.setValue.call (this, v); This.setrawvalue (v);//No This sentence does not show 1.00 return ret on the control; }, Fixprecision:function (value) {var nan = IsNaN (value); if (!this.allowdecimals | | this.decimalprecision = =-1 | | nan | |!value) {return nan? ": value; } value = This.replacedecimalval (value); return parsefloat (value). toFixed (this.decimalprecision); },//Prevent rounding Replacedecimalval:function (v) {var Varr = v.tostring (). Split ('. '); if (Varr.length > 1) {if (varr[1] > This.decimalprecision) {var dec = varr[1].substring (0, This.dEcimalprecision); v = varr[0] + '. ' + Dec; }} return v; }}


Ext.tree.Panel

Property:

    rootvisible:true//displays the root node of the tree, False does not show that collapsible:true//true can point left arrow collapsed, false non-collapsible leaf:true//true is a child node, and no child nodes.               expanded:true//set node self-initiated root: {//tree node text: ' $ ',//node display content expanded:true,//expand node                       Children: [//Sub-node {text: ' Department 1 ', Expanded:true,                   Children: [{id: ' 1 ', Text: ' Power1 ', leaf:true}]                        }, {text: ' Department 2 ', expanded:true}, {text: ' Department 3 ',  Expanded:true, Children: [{text: ' Power1 ', leaf: True}, {text: ' Power2 ', leaf:true}, {text: ' Power3 ', leaf:true  }]}]} listeners: {itemclick:function (TREEPNL, Record, item, index, E) The Click event of the {//tree node//record.data.root=true indicates that the node is the root node//record.data.parentid = ' Root ' indicates that the parent node of the node is the root node, and also the ID of the parent node if (!record.data.root && record.data.parentId! = ' root ') {var parenttext = record.parentnode.data.t ext;//the contents of the parent node var text = item.innertext;//The current node's display ext.getcmp (' Displaypstgroupname '). Setvalu               E (Parenttext);           EXT.GETCMP (' Displaypstname '). SetValue (text);               } else {ext.getcmp (' displaypstgroupname '). SetValue (');           EXT.GETCMP (' Displaypstname '). SetValue (');    }} cellclick:function (view, E, ColumnIndex, Rowitem) {?    ?    View://e://columnindex: The index of the point column, 0 starts//rowitem:rowitem.data indicates the data of the selected row?    ? }    }


Method:

    Setnodefocus (Node ID)//Set a node for the selected state    collapse ()//Let the entire tree fold up    ext.getcmp (' treepnl '). CollapseAll ();//Collapse all nodes    EXT.GETCMP (' TREEPNL '). GetStore (). Getnodebyid (' root '). expand ();//Expand root node


Ext.gridstore

Property:

    autoload:true//self-loading data    datafields:[{name:event_id}]//field name

Method:


var mingentime = store.min (' event_gen_time ');//Get field Event_gen_time min var r = {};store.each (function (record) {//Traverse data           if (record.get (' event_gen_time ') = = Mingentime) {               r = record.raw;//Gets a data               return;           }});

Event:


Beforeload:function (store, operation, options) {}//events occurred before data loading datachanged:function (store, options) {}//events that occur after the data has changed


Ext.grid.Panel

Property:

    multiselect:true//agrees that item can be multiple, false not    SelType: ' Cellmodel '//Indicates the cell is selected, no attribute is selected for the row    plugins: [Ext.create (' Ext.grid.plugin.CellEditing ', {clickstoedit:1})]//the property mates with SelType: ' Cellmodel ' to enable editing of the cell effect    columns:[new Ext.grid.RowNumberer ({width:30, Locked:false, Header: ""})]//self-promotion

Method:

    EXT.GETCMP (' gridevent '). GetStore (). RemoveAll ();//Clears the record in the grid ext.getcmp (' grid '). Plugins[0].completeedit ();// When Cellediting, the editor does not directly leave the focus but directly point to submit. In this case, the edit is still the original value. The solution is to tune the Completeedit method treepnl.fireevent (' ItemClick ', TREEPNL, Treepnl.getselectionmodel (). getlastselected ());// Trigger the TreeNode Click event//Join Event ext.getcmp (' xxxxx '). On (' event name ', function () {})//js date control to format the date and then send the value back to the background create_time:! Ext.isempty ()? ": Ext.util.Format.date (ext.getcmp (' Datefieldloginbegin '). GetValue (), ' y/m/d ')//date control check ext.getcmp (' Datefields Tartdate '). IsValid ()//tabpanel subkey Join Close Event Contentpanel.add ({Id:nodeid, Title:nodetext, C Losable:true, Header:false, listeners: {' Beforedestroy ': function () {Calldestroy (nodeId);}},//Join TAB item closing event HTML: ' <iframe scrolling= "auto" frameborder= "0" width= "100%" height= "100%" src= "' + Node.attribute    S.actionpath + ' ></iframe> '}); Title Centered title: ' Data Overview ', Titlealign: ' CenteR ', style: ' Text-align:center ',//Resolve double-click TreeNode to become directory Treeitemclick:function (TREEPNL, record, item, index, e) { Record.data.leaf = true;//in the last line of the Treeclick method add this sentence},



Related properties of ExtJS

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.