Extjs learning Summary (continuously updated)

Source: Internet
Author: User

1. How to disable or enable a menu

Sometimes, when we do OA, we sometimes enable or disable a menu item as needed. In extjs, we can perform the following operations.

 

 

1 Ext. onready (function (){
2 Ext. blank_image_url = 'resources/images/default/s.gif ';
3 Ext. quicktips. INIT ();
4 var TB = new Ext. toolbar ({
5 applyto: 'tb ',
6 width: 400
7 });
8 var stylemenu = new Ext. Menu. menu ({
9 items :[{
10 text: 'topic select ',
11 ID: 'style ',
12 menu: New Ext. Menu. menu ({
13 items :[{
14 text: 'Red theme ',
15 checked: True,
16 group: 'Theme'
17 },{
18 Text: 'Blue theme ',
19 checked: false,
20 group: 'Theme'
21 },{
22 text: 'black theme ',
23 checked: false,
24 group: 'Theme'
25}]
26 })
27 },{
28 text: 'Enable theme ',
29 Checked: True,
30 checkhandler: function () {Ext. getcmp ('style'). setdisabled (! This. Checked )}
31}]
32 });
33 TB. Add ({text: 'topic ', menu: stylemenu });
34 });

 

2. How to set the default value of datefield.

To set the default value of datefield, you can directly assign values to the value attribute, for example, value: '2014/1/123'. To set the default value to the date of the current day, you can set it as follows: Value: New Date

1 New Ext. Form. datefield ({
2 ID: 'df ',
3 fieldlabel: 'date ',
4 format: 'Y-m-d ',
5 width: 150,
6 // value: '2017/123'
7 value: New Date
8 })
9

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.