Extjs tips (1)

Source: Internet
Author: User

1. Three methods for obtaining field from form:

1,Ext. getcmp ('id ');

2. formpanel. getform (). findfield ('Id/name ');

3. Ext. Get ('Id/name'); // The premise is that formpanel is displayed on the interface.

 

Ii. How extjs assigns a value to textfield:

VaR value = "value ";

1. fs. Form. findfield (ID/Name). setvalue (value );

2. Ext. Get (ID/Name). setvalue (value );

3. Ext. getcmp (ID). setvalue (value );

 

III,EXT Grid

 

In ext grid, assume that there is an object named grid.

(1) grid. getstore (). getrange (0, store. getcount (); // obtain all rows of the grid.

(2) grid. getselectionmodel (). getselections () // You can select all rows.

(3) grid. selmodel. Selections. items; // You can select all rows.

(4) grid. getselectionmodel (). getselected (); // obtain the first row of the selected row.

 

IV,Automatic combo assignment when formpanel component loads data

Combo has the hiddenname attribute, which is the actually submitted value. When loading, you can set this attribute to reader and then automatically select the specified value, for example: hiddenname: 'value', your reader should have a {Name: 'value '}.

 

V,Extjs form resetting Method:

There are three ways to reset form forms. Assume var FS = new Ext. Form. formpanel ({...});
(1) fs. Form. Reset (); // reset form
(2) fs. getform (). getel (). Dom. Reset (); // reset form
(3) Ext. getcmp ('fs'). Form. Reset ();

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.