In EXT, click the button grid to add an instance code line (you can set the cursor position). extgrid

Source: Internet
Author: User

In EXT, click the button grid to add an instance code line (you can set the cursor position). extgrid

Let's talk about ext.

Ext is a powerful js class library, previously based on YAHOO-UI, And now completely independent, mainly including data, widgets, form, grid, dd, menu, the most powerful one is grid. The programming idea is based on object-oriented Programming (oop), and the scalability is quite good. you can write extensions by yourself. customize the namespace. web applications may feel too big. however, you can load the class library as needed.

The main package contains three large files ext-all.css, ext-base.js, ext-all.js (including all the class libraries, you can delete as needed. this interface is provided on the official website) When you reference the ext class library. these three files are essential.

It provides a rich and beautiful appearance experience, and has become a popular choice for many interface layer developers! Its core components basically cover the common components used to build rich clients.

Starting with Ext 2, the commercial version (for profitable developers) will be charged.
This may affect some of his application prospects. The latest version is 3.2.2.

1. Create an Add button. In the listeners event, click the button event,

{Id: 'button1', xtype: 'button ', margin: '6', text: 'add', name: 'btn-add', iconCls: 'btn-add', listeners: {click: function () {var r = Ext. create ('itemgridmdl ',{//............}); // The data Ext. getCmp ('grid1 '). getStore (). insert (Ext. getCmp ('grid1 '). getStore (). getCount (), r); // Add a cellEditing row at the end of the table. cancelEdit (); cellEditing. startEditByPosition ({// the position where the cursor appears in the table to be edited row: Ext. getCmp ('grid1 '). getStore (). getCount ()-1, column: 1 });}}}

2. Call the button Method

Ext.getCmp('fbutton').fireEvent('click');

3. plugins: attribute configuration in the grid table:

plugins:[cellEditing=Ext.create('Ext.grid.plugin.CellEditing', {clicksToEdit:1,listeners: {edit: function(editor,e) {}}})],

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.