Ext. Net learning essay 002 default button, ext. net002

Source: Internet
Author: User

Ext. Net learning essay 002 default button, ext. net002

Press enter in FormPanel to trigger the click Event of the default button. The setting method is to set the DefaultButton attribute in FormPanel. If this attribute is not set, the last button is used by default.

1. The last button is the default button by default.

X. formPanel (). buttons (X. button (). text ('first click'), X. button (). text ('default click '). onClientClick ("Ext. msg. alert ('Press enter default triggered event', 'trigger button is the last button ')"))

2. Number the number to indicate the default button

X. formPanel (). defaultButton ('2 '). buttons (X. button (). text ('first click'), X. button (). text ('default click '). onClientClick ("Ext. msg. alert ('Press enter default triggered event', 'trigger button is the last button ') "), X. button (). text ('third click '))

3. Specify the default button with ID

X. formPanel (). defaultButton ('button 2 '). buttons (X. button (). text ('first click'), X. button (). ID ('button 2 '). text ('default click '). onClientClick ("Ext. msg. alert ('Press enter default triggered event', 'trigger button is the last button ') "), X. button (). text ('third click '))

4. Specify the default button with the selector

X. formPanel (). defaultButton ('button [text = default button] '). buttons (X. button (). text ('first click'), X. button (). text ('default click '). onClientClick ("Ext. msg. alert ('Press enter default triggered event', 'trigger button is the last button ') "), X. button (). text ('third click '))

The complete view code is as follows:

@ Using Ext. Net; @ using Ext. Net. MVC; @ {Layout = null; var X = Html. X () ;}<! DOCTYPE html> 

 

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.